summary refs log tree commit diff
path: root/crypto/src/cms
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-07-20 19:01:12 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-07-20 19:01:12 +0700
commite5d77a0741bcc55088054b2ad4a91ab0508ac092 (patch)
tree816fc0d1139945ee9bfd22ca40f1e570e816a02f /crypto/src/cms
parentRefactoring in Asn1.Crmf (diff)
downloadBouncyCastle.NET-ed25519-e5d77a0741bcc55088054b2ad4a91ab0508ac092.tar.xz
Refactoring in Asn1.Cms
Diffstat (limited to 'crypto/src/cms')
-rw-r--r--crypto/src/cms/CMSUtils.cs2
-rw-r--r--crypto/src/cms/KeyTransRecipientInfoGenerator.cs2
-rw-r--r--crypto/src/cms/SignerInfoGenerator.cs3
3 files changed, 3 insertions, 4 deletions
diff --git a/crypto/src/cms/CMSUtils.cs b/crypto/src/cms/CMSUtils.cs
index 56509ed7f..d84c0afd7 100644
--- a/crypto/src/cms/CMSUtils.cs
+++ b/crypto/src/cms/CMSUtils.cs
@@ -187,7 +187,7 @@ namespace Org.BouncyCastle.Cms
 		internal static IssuerAndSerialNumber GetIssuerAndSerialNumber(X509Certificate cert)
 		{
 			TbsCertificateStructure tbsCert = GetTbsCertificateStructure(cert);
-			return new IssuerAndSerialNumber(tbsCert.Issuer, tbsCert.SerialNumber.Value);
+			return new IssuerAndSerialNumber(tbsCert.Issuer, tbsCert.SerialNumber);
 		}
 
         internal static Asn1.Cms.AttributeTable ParseAttributeTable(Asn1SetParser parser)
diff --git a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs
index 9a2cbc5b0..a998ac90f 100644
--- a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs
+++ b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs
@@ -19,7 +19,7 @@ namespace Org.BouncyCastle.Cms
         private Asn1OctetString m_subjectKeyIdentifier;
 
         public KeyTransRecipientInfoGenerator(X509Certificate recipCert, IKeyWrapper keyWrapper)
-            : this(new IssuerAndSerialNumber(recipCert.IssuerDN, new DerInteger(recipCert.SerialNumber)), keyWrapper)
+            : this(new IssuerAndSerialNumber(recipCert.CertificateStructure), keyWrapper)
         {
         }
 
diff --git a/crypto/src/cms/SignerInfoGenerator.cs b/crypto/src/cms/SignerInfoGenerator.cs
index 2fa185885..04c437614 100644
--- a/crypto/src/cms/SignerInfoGenerator.cs
+++ b/crypto/src/cms/SignerInfoGenerator.cs
@@ -130,8 +130,7 @@ namespace Org.BouncyCastle.Cms
          */
         public SignerInfoGenerator Build(ISignatureFactory contentSigner, X509Certificate certificate)
         {
-            SignerIdentifier sigId = new SignerIdentifier(new IssuerAndSerialNumber(certificate.IssuerDN,
-                new DerInteger(certificate.SerialNumber)));
+            SignerIdentifier sigId = new SignerIdentifier(new IssuerAndSerialNumber(certificate.CertificateStructure));
 
             SignerInfoGenerator sigInfoGen = CreateGenerator(contentSigner, sigId);