summary refs log tree commit diff
path: root/crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 15:37:25 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 15:37:25 +0700
commit3ce45e18811232677715a3bf4ba144a72b639942 (patch)
tree228c87fb260e125c66b34334cedb9b34b07a4dac /crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs
parentGenerics migration in Crmf, Crypto, Math (diff)
downloadBouncyCastle.NET-ed25519-3ce45e18811232677715a3bf4ba144a72b639942.tar.xz
Generics migration in Ocsp, OpenPgp
Diffstat (limited to 'crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs')
-rw-r--r--crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs13
1 files changed, 3 insertions, 10 deletions
diff --git a/crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs b/crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs
index 3987012ae..07b9fee17 100644
--- a/crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs
+++ b/crypto/src/openpgp/PgpSignatureSubpacketGenerator.cs
@@ -1,16 +1,14 @@
 using System;
-using System.Collections;
+using System.Collections.Generic;
 
 using Org.BouncyCastle.Bcpg.Sig;
-using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Bcpg.OpenPgp
 {
 	/// <remarks>Generator for signature subpackets.</remarks>
     public class PgpSignatureSubpacketGenerator
     {
-        private IList list = Platform.CreateArrayList();
-
+        private readonly List<SignatureSubpacket> list = new List<SignatureSubpacket>();
 
         /// <summary>
         ///Base constructor, creates an empty generator.
@@ -225,12 +223,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 
 		public PgpSignatureSubpacketVector Generate()
         {
-            SignatureSubpacket[] a = new SignatureSubpacket[list.Count];
-            for (int i = 0; i < list.Count; ++i)
-            {
-                a[i] = (SignatureSubpacket)list[i];
-            }
-            return new PgpSignatureSubpacketVector(a);
+            return new PgpSignatureSubpacketVector(list.ToArray());
         }
     }
 }