Add and use IntValueExact properties
4 files changed, 6 insertions, 6 deletions
diff --git a/crypto/src/cms/CMSSignedData.cs b/crypto/src/cms/CMSSignedData.cs
index 237c1528e..979be6535 100644
--- a/crypto/src/cms/CMSSignedData.cs
+++ b/crypto/src/cms/CMSSignedData.cs
@@ -147,7 +147,7 @@ namespace Org.BouncyCastle.Cms
/// <summary>Return the version number for this object.</summary>
public int Version
{
- get { return signedData.Version.Value.IntValue; }
+ get { return signedData.Version.IntValueExact; }
}
/**
diff --git a/crypto/src/cms/CMSSignedDataParser.cs b/crypto/src/cms/CMSSignedDataParser.cs
index fb51ab119..c25f0aad0 100644
--- a/crypto/src/cms/CMSSignedDataParser.cs
+++ b/crypto/src/cms/CMSSignedDataParser.cs
@@ -179,7 +179,7 @@ namespace Org.BouncyCastle.Cms
*/
public int Version
{
- get { return _signedData.Version.Value.IntValue; }
+ get { return _signedData.Version.IntValueExact; }
}
public ISet DigestOids
diff --git a/crypto/src/cms/CMSSignedDataStreamGenerator.cs b/crypto/src/cms/CMSSignedDataStreamGenerator.cs
index 0a3e0c87e..f6bdacb06 100644
--- a/crypto/src/cms/CMSSignedDataStreamGenerator.cs
+++ b/crypto/src/cms/CMSSignedDataStreamGenerator.cs
@@ -732,7 +732,7 @@ namespace Org.BouncyCastle.Cms
{
SignerInfo s = SignerInfo.GetInstance(si.ToSignerInfo());
- if (s.Version.Value.IntValue == 3)
+ if (s.Version.IntValueExact == 3)
{
return true;
}
diff --git a/crypto/src/cms/SignerInformation.cs b/crypto/src/cms/SignerInformation.cs
index c262806a8..3643c6fe3 100644
--- a/crypto/src/cms/SignerInformation.cs
+++ b/crypto/src/cms/SignerInformation.cs
@@ -129,7 +129,7 @@ namespace Org.BouncyCastle.Cms
*/
public int Version
{
- get { return info.Version.Value.IntValue; }
+ get { return info.Version.IntValueExact; }
}
public AlgorithmIdentifier DigestAlgorithmID
@@ -349,8 +349,8 @@ namespace Org.BouncyCastle.Cms
throw new CmsException("RSASSA-PSS signature parameters specified unknown MGF");
IDigest pssDigest = DigestUtilities.GetDigest(pss.HashAlgorithm.Algorithm);
- int saltLength = pss.SaltLength.Value.IntValue;
- byte trailerField = (byte) pss.TrailerField.Value.IntValue;
+ int saltLength = pss.SaltLength.IntValueExact;
+ byte trailerField = (byte)pss.TrailerField.IntValueExact;
// RFC 4055 3.1
// The value MUST be 1, which represents the trailer field with hexadecimal value 0xBC
|