summary refs log tree commit diff
path: root/crypto/src/cms/CMSEnvelopedGenerator.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 11:01:05 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 11:01:05 +0700
commit18c67ac1339c9ca4f3604f5e5d44da0263b9ad21 (patch)
tree32fe34fa1251ddb8c5529d9a39a31a68641dd257 /crypto/src/cms/CMSEnvelopedGenerator.cs
parentGenerics migration in Bcpg, Bzip2, Cmp (diff)
downloadBouncyCastle.NET-ed25519-18c67ac1339c9ca4f3604f5e5d44da0263b9ad21.tar.xz
Generics migration in Cms
Diffstat (limited to 'crypto/src/cms/CMSEnvelopedGenerator.cs')
-rw-r--r--crypto/src/cms/CMSEnvelopedGenerator.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crypto/src/cms/CMSEnvelopedGenerator.cs b/crypto/src/cms/CMSEnvelopedGenerator.cs
index d7d3e4bbf..e0a94c4d3 100644
--- a/crypto/src/cms/CMSEnvelopedGenerator.cs
+++ b/crypto/src/cms/CMSEnvelopedGenerator.cs
@@ -1,5 +1,5 @@
 using System;
-using System.Collections;
+using System.Collections.Generic;
 
 using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cms;
@@ -13,7 +13,6 @@ using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Operators;
 using Org.BouncyCastle.Crypto.Parameters;
 using Org.BouncyCastle.Security;
-using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.X509;
 
 namespace Org.BouncyCastle.Cms
@@ -100,7 +99,7 @@ namespace Org.BouncyCastle.Cms
 		public static readonly string ECDHSha1Kdf		= X9ObjectIdentifiers.DHSinglePassStdDHSha1KdfScheme.Id;
 		public static readonly string ECMqvSha1Kdf		= X9ObjectIdentifiers.MqvSinglePassSha1KdfScheme.Id;
 
-		internal readonly IList recipientInfoGenerators = Platform.CreateArrayList();
+		internal readonly IList<RecipientInfoGenerator> recipientInfoGenerators = new List<RecipientInfoGenerator>();
 		internal readonly SecureRandom rand;
 
         internal CmsAttributeTableGenerator unprotectedAttributeGenerator = null;
@@ -216,7 +215,7 @@ namespace Org.BouncyCastle.Cms
 			X509Certificate			recipientCert,
 			string					cekWrapAlgorithm)
 		{
-            IList recipientCerts = Platform.CreateArrayList(1);
+            var recipientCerts = new List<X509Certificate>(1);
 			recipientCerts.Add(recipientCert);
 
 			AddKeyAgreementRecipients(agreementAlgorithm, senderPrivateKey, senderPublicKey,
@@ -238,7 +237,7 @@ namespace Org.BouncyCastle.Cms
 			string					agreementAlgorithm,
 			AsymmetricKeyParameter	senderPrivateKey,
 			AsymmetricKeyParameter	senderPublicKey,
-			ICollection				recipientCerts,
+			IEnumerable<X509Certificate> recipientCerts,
 			string					cekWrapAlgorithm)
 		{
 			if (!senderPrivateKey.IsPrivate)
@@ -254,7 +253,7 @@ namespace Org.BouncyCastle.Cms
 			KeyAgreeRecipientInfoGenerator karig = new KeyAgreeRecipientInfoGenerator();
 			karig.KeyAgreementOID = new DerObjectIdentifier(agreementAlgorithm);
 			karig.KeyEncryptionOID = new DerObjectIdentifier(cekWrapAlgorithm);
-			karig.RecipientCerts = recipientCerts;
+			karig.RecipientCerts = new List<X509Certificate>(recipientCerts);
 			karig.SenderKeyPair = new AsymmetricCipherKeyPair(senderPublicKey, senderPrivateKey);
 
 			recipientInfoGenerators.Add(karig);