diff options
author | David Hook <dgh@bouncycastle.org> | 2019-01-18 12:37:57 +1100 |
---|---|---|
committer | David Hook <dgh@bouncycastle.org> | 2019-01-18 12:37:57 +1100 |
commit | e0d1810b2d2bbbee4cf8fa6707c3f9b817b94d62 (patch) | |
tree | 331caddf0c8ed6ccdc8321d699ffd5af9bcea233 /crypto/test | |
parent | added use of IKeyWrapper for managing CMS KeyTransRecipient (diff) | |
download | BouncyCastle.NET-ed25519-e0d1810b2d2bbbee4cf8fa6707c3f9b817b94d62.tar.xz |
added use of IKeyWrapper for managing CMS KeyTransRecipient
Diffstat (limited to 'crypto/test')
-rw-r--r-- | crypto/test/src/crmf/test/CrmfTest.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crypto/test/src/crmf/test/CrmfTest.cs b/crypto/test/src/crmf/test/CrmfTest.cs index caff0e664..7d459ee79 100644 --- a/crypto/test/src/crmf/test/CrmfTest.cs +++ b/crypto/test/src/crmf/test/CrmfTest.cs @@ -21,6 +21,7 @@ using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Encoders; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; +using Org.BouncyCastle.Operators; namespace Org.BouncyCastle.Crmf.Tests { @@ -114,12 +115,8 @@ namespace Org.BouncyCastle.Crmf.Tests certificateRequestMessageBuilder.AddControl( new PKIArchiveControlBuilder(privateInfo, new GeneralName(new X509Name("CN=Test"))) - .AddRecipientGenerator(new KeyTransRecipientInfoGenerator() - { - RecipientCert = cert, - SubjectKeyIdentifier = (DerOctetString)SubjectKeyIdentifier.CreateSha1KeyIdentifier(publicKeyInfo).ToAsn1Object() - }).Build(new CmsContentEncryptorBuilder(NistObjectIdentifiers.IdAes128Cbc) - .Build()) + .AddRecipientGenerator(new CmsKeyTransRecipientInfoGenerator(cert, new Asn1KeyWrapper("RSA/None/OAEPwithSHA256andMGF1Padding", cert))) + .Build(new CmsContentEncryptorBuilder(NistObjectIdentifiers.IdAes128Cbc).Build()) ); var msg = certificateRequestMessageBuilder.Build(); |