1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/src/asn1/x509/UserNotice.cs b/crypto/src/asn1/x509/UserNotice.cs
index 5938f7c49..f40916434 100644
--- a/crypto/src/asn1/x509/UserNotice.cs
+++ b/crypto/src/asn1/x509/UserNotice.cs
@@ -58,6 +58,7 @@ namespace Org.BouncyCastle.Asn1.X509
* calling @{link toASN1Object()} for a <code>UserNotice</code>
* instance or from parsing it from a DER-encoded stream.</p>
*/
+ [Obsolete("Use GetInstance() instead")]
public UserNotice(
Asn1Sequence seq)
{
@@ -71,12 +72,19 @@ namespace Org.BouncyCastle.Asn1.X509
if (seq[0].ToAsn1Object() is Asn1Sequence)
{
noticeRef = NoticeReference.GetInstance(seq[0]);
+ explicitText = null;
}
else
{
+ noticeRef = null;
explicitText = DisplayText.GetInstance(seq[0]);
}
}
+ else if (seq.Count == 0)
+ {
+ noticeRef = null; // neither field set!
+ explicitText = null;
+ }
else
{
throw new ArgumentException("Bad sequence size: " + seq.Count);
|