From 4ea1816cffd5c8663bc9ae1234df0a70ef23fcd6 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Mon, 27 Jun 2022 02:19:14 +0700 Subject: Generics migration work --- crypto/src/asn1/x509/V2TBSCertListGenerator.cs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'crypto/src/asn1/x509/V2TBSCertListGenerator.cs') diff --git a/crypto/src/asn1/x509/V2TBSCertListGenerator.cs b/crypto/src/asn1/x509/V2TBSCertListGenerator.cs index 2c929188f..1d58751fd 100644 --- a/crypto/src/asn1/x509/V2TBSCertListGenerator.cs +++ b/crypto/src/asn1/x509/V2TBSCertListGenerator.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using System.IO; using Org.BouncyCastle.Utilities; @@ -36,7 +36,7 @@ namespace Org.BouncyCastle.Asn1.X509 private X509Name issuer; private Time thisUpdate, nextUpdate; private X509Extensions extensions; - private IList crlEntries; + private List crlEntries; public V2TbsCertListGenerator() { @@ -80,12 +80,11 @@ namespace Org.BouncyCastle.Asn1.X509 this.nextUpdate = nextUpdate; } - public void AddCrlEntry( - Asn1Sequence crlEntry) + public void AddCrlEntry(Asn1Sequence crlEntry) { if (crlEntries == null) { - crlEntries = Platform.CreateArrayList(); + crlEntries = new List(); } crlEntries.Add(crlEntry); @@ -104,8 +103,8 @@ namespace Org.BouncyCastle.Asn1.X509 public void AddCrlEntry(DerInteger userCertificate, Time revocationDate, int reason, DerGeneralizedTime invalidityDate) { - IList extOids = Platform.CreateArrayList(); - IList extValues = Platform.CreateArrayList(); + var extOids = new List(); + var extValues = new List(); if (reason != 0) { @@ -147,8 +146,7 @@ namespace Org.BouncyCastle.Asn1.X509 public void AddCrlEntry(DerInteger userCertificate, Time revocationDate, X509Extensions extensions) { - Asn1EncodableVector v = new Asn1EncodableVector( - userCertificate, revocationDate); + Asn1EncodableVector v = new Asn1EncodableVector(userCertificate, revocationDate); if (extensions != null) { @@ -182,12 +180,7 @@ namespace Org.BouncyCastle.Asn1.X509 // Add CRLEntries if they exist if (crlEntries != null) { - Asn1Sequence[] certs = new Asn1Sequence[crlEntries.Count]; - for (int i = 0; i < crlEntries.Count; ++i) - { - certs[i] = (Asn1Sequence)crlEntries[i]; - } - v.Add(new DerSequence(certs)); + v.Add(new DerSequence(crlEntries.ToArray())); } if (extensions != null) -- cgit 1.4.1