diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-02-08 19:26:46 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-02-08 19:26:46 +0700 |
commit | 50335415dd4d1809782181874e38a275734b76f5 (patch) | |
tree | 36ce4b945cf1326487e168cda480ed7fd3e2d9d9 /crypto/src/asn1/cms | |
parent | Env. var. to enforce correct X.509 cert encoding (diff) | |
download | BouncyCastle.NET-ed25519-50335415dd4d1809782181874e38a275734b76f5.tar.xz |
New HasValue methods
Diffstat (limited to 'crypto/src/asn1/cms')
-rw-r--r-- | crypto/src/asn1/cms/AuthEnvelopedData.cs | 2 | ||||
-rw-r--r-- | crypto/src/asn1/cms/AuthEnvelopedDataParser.cs | 2 | ||||
-rw-r--r-- | crypto/src/asn1/cms/EnvelopedData.cs | 2 | ||||
-rw-r--r-- | crypto/src/asn1/cms/SignedData.cs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/asn1/cms/AuthEnvelopedData.cs b/crypto/src/asn1/cms/AuthEnvelopedData.cs index c6e1e3bb5..4ca86e9df 100644 --- a/crypto/src/asn1/cms/AuthEnvelopedData.cs +++ b/crypto/src/asn1/cms/AuthEnvelopedData.cs @@ -57,7 +57,7 @@ namespace Org.BouncyCastle.Asn1.Cms // "It MUST be set to 0." Asn1Object tmp = seq[index++].ToAsn1Object(); version = DerInteger.GetInstance(tmp); - if (version.IntValueExact != 0) + if (!version.HasValue(0)) throw new ArgumentException("AuthEnvelopedData version number must be 0"); tmp = seq[index++].ToAsn1Object(); diff --git a/crypto/src/asn1/cms/AuthEnvelopedDataParser.cs b/crypto/src/asn1/cms/AuthEnvelopedDataParser.cs index 52f0bf720..950040b26 100644 --- a/crypto/src/asn1/cms/AuthEnvelopedDataParser.cs +++ b/crypto/src/asn1/cms/AuthEnvelopedDataParser.cs @@ -31,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.Cms // "It MUST be set to 0." this.version = (DerInteger)seq.ReadObject(); - if (version.IntValueExact != 0) + if (!version.HasValue(0)) throw new Asn1ParsingException("AuthEnvelopedData version number must be 0"); } diff --git a/crypto/src/asn1/cms/EnvelopedData.cs b/crypto/src/asn1/cms/EnvelopedData.cs index fbde00b28..8897fe380 100644 --- a/crypto/src/asn1/cms/EnvelopedData.cs +++ b/crypto/src/asn1/cms/EnvelopedData.cs @@ -154,7 +154,7 @@ namespace Org.BouncyCastle.Asn1.Cms { RecipientInfo ri = RecipientInfo.GetInstance(o); - if (ri.Version.IntValueExact != 0) + if (!ri.Version.HasValue(0)) { return 2; } diff --git a/crypto/src/asn1/cms/SignedData.cs b/crypto/src/asn1/cms/SignedData.cs index 5eba8390d..1e97346e6 100644 --- a/crypto/src/asn1/cms/SignedData.cs +++ b/crypto/src/asn1/cms/SignedData.cs @@ -147,7 +147,7 @@ namespace Org.BouncyCastle.Asn1.Cms { SignerInfo s = SignerInfo.GetInstance(obj); - if (s.Version.IntValueExact == 3) + if (s.Version.HasValue(3)) { return true; } |