summary refs log tree commit diff
path: root/crypto/src/cms/KeyTransRecipientInfoGenerator.cs
diff options
context:
space:
mode:
authorDavid Hook <dgh@bouncycastle.org>2019-01-19 15:38:11 +1100
committerDavid Hook <dgh@bouncycastle.org>2019-01-19 15:38:11 +1100
commit60b001da03e19c8e22ce8d7f448e9c752e3ebdfa (patch)
tree5f3c200fbf03a998ee186b3a0861a781f0f7f57c /crypto/src/cms/KeyTransRecipientInfoGenerator.cs
parent Missing file from last commit (diff)
downloadBouncyCastle.NET-ed25519-60b001da03e19c8e22ce8d7f448e9c752e3ebdfa.tar.xz
fixed KeyTransRecipientInfoGenerator to invoke overridable method for wrapping symmetric session key
Diffstat (limited to 'crypto/src/cms/KeyTransRecipientInfoGenerator.cs')
-rw-r--r--crypto/src/cms/KeyTransRecipientInfoGenerator.cs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs
index b18d18153..23b06d3b3 100644
--- a/crypto/src/cms/KeyTransRecipientInfoGenerator.cs
+++ b/crypto/src/cms/KeyTransRecipientInfoGenerator.cs
@@ -73,14 +73,11 @@ namespace Org.BouncyCastle.Cms
 
         public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random)
         {
-            byte[] keyBytes = contentEncryptionKey.GetKey();
             AlgorithmIdentifier keyEncryptionAlgorithm = this.AlgorithmDetails;
 
             this.random = random;
 
-            IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.Algorithm.Id);
-            keyWrapper.Init(true, new ParametersWithRandom(recipientPublicKey, random));
-            byte[] encryptedKeyBytes = keyWrapper.Wrap(keyBytes, 0, keyBytes.Length);
+            byte[] encryptedKeyBytes = GenerateWrappedKey(contentEncryptionKey);
 
             RecipientIdentifier recipId;
             if (recipientTbsCert != null)