From e0d1810b2d2bbbee4cf8fa6707c3f9b817b94d62 Mon Sep 17 00:00:00 2001 From: David Hook Date: Fri, 18 Jan 2019 12:37:57 +1100 Subject: added use of IKeyWrapper for managing CMS KeyTransRecipient --- crypto/test/src/crmf/test/CrmfTest.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'crypto/test') 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(); -- cgit 1.4.1