diff options
Diffstat (limited to 'crypto/src/cms')
-rw-r--r-- | crypto/src/cms/CMSEnvelopedGenerator.cs | 13 | ||||
-rw-r--r-- | crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/crypto/src/cms/CMSEnvelopedGenerator.cs b/crypto/src/cms/CMSEnvelopedGenerator.cs index 401f4d2e8..9830cefcc 100644 --- a/crypto/src/cms/CMSEnvelopedGenerator.cs +++ b/crypto/src/cms/CMSEnvelopedGenerator.cs @@ -139,12 +139,12 @@ namespace Org.BouncyCastle.Cms * @param cert recipient's public key certificate * @exception ArgumentException if there is a problem with the certificate */ - public void AddKeyTransRecipient( - X509Certificate cert) + public void AddKeyTransRecipient(X509Certificate cert) { TbsCertificateStructure recipientTbsCert = CmsUtilities.GetTbsCertificateStructure(cert); SubjectPublicKeyInfo info = recipientTbsCert.SubjectPublicKeyInfo; - this.AddRecipientInfoGenerator(new KeyTransRecipientInfoGenerator(cert, new Asn1KeyWrapper(info.AlgorithmID.Algorithm, info.AlgorithmID.Parameters, cert))); + AddRecipientInfoGenerator( + new KeyTransRecipientInfoGenerator(cert, new Asn1KeyWrapper(info.Algorithm, cert))); } /** @@ -154,12 +154,11 @@ namespace Org.BouncyCastle.Cms * @param subKeyId the identifier for the recipient's public key * @exception ArgumentException if there is a problem with the key */ - public void AddKeyTransRecipient( - AsymmetricKeyParameter pubKey, - byte[] subKeyId) + public void AddKeyTransRecipient(AsymmetricKeyParameter pubKey, byte[] subKeyId) { SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(pubKey); - this.AddRecipientInfoGenerator(new KeyTransRecipientInfoGenerator(subKeyId, new Asn1KeyWrapper(info.AlgorithmID.Algorithm, info.AlgorithmID.Parameters, pubKey))); + AddRecipientInfoGenerator( + new KeyTransRecipientInfoGenerator(subKeyId, new Asn1KeyWrapper(info.Algorithm, pubKey))); } /** diff --git a/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs b/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs index 97fbd115b..ab7c1a0bd 100644 --- a/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs +++ b/crypto/src/cms/KeyAgreeRecipientInfoGenerator.cs @@ -150,6 +150,6 @@ namespace Org.BouncyCastle.Cms CreateOriginatorPublicKey(SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey)); private static OriginatorPublicKey CreateOriginatorPublicKey(SubjectPublicKeyInfo originatorKeyInfo) => - new OriginatorPublicKey(originatorKeyInfo.AlgorithmID, originatorKeyInfo.PublicKeyData); + new OriginatorPublicKey(originatorKeyInfo.Algorithm, originatorKeyInfo.PublicKey); } } |