diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-29 14:15:10 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-29 14:15:10 +0700 |
commit | 435210f10fd927653ce8fbc04ec537ae5d8966b6 (patch) | |
tree | 27b6ed1c029db271c3429ac57629d7f0156c5fed /crypto/src/x509/X509Crl.cs | |
parent | Refactoring around Platform (diff) | |
download | BouncyCastle.NET-ed25519-435210f10fd927653ce8fbc04ec537ae5d8966b6.tar.xz |
Generics migration complete
Diffstat (limited to 'crypto/src/x509/X509Crl.cs')
-rw-r--r-- | crypto/src/x509/X509Crl.cs | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/crypto/src/x509/X509Crl.cs b/crypto/src/x509/X509Crl.cs index 9acebf2dd..921e9881b 100644 --- a/crypto/src/x509/X509Crl.cs +++ b/crypto/src/x509/X509Crl.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using System.IO; using System.Text; @@ -12,7 +12,6 @@ using Org.BouncyCastle.Math; using Org.BouncyCastle.Security; using Org.BouncyCastle.Security.Certificates; using Org.BouncyCastle.Utilities; -using Org.BouncyCastle.Utilities.Collections; using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Encoders; using Org.BouncyCastle.X509.Extension; @@ -174,13 +173,13 @@ namespace Org.BouncyCastle.X509 } } - private ISet LoadCrlEntries() + private ISet<X509CrlEntry> LoadCrlEntries() { - ISet entrySet = new HashSet(); - IEnumerable certs = c.GetRevokedCertificateEnumeration(); + var entrySet = new HashSet<X509CrlEntry>(); + var revoked = c.GetRevokedCertificateEnumeration(); X509Name previousCertificateIssuer = IssuerDN; - foreach (CrlEntry entry in certs) + foreach (CrlEntry entry in revoked) { X509CrlEntry crlEntry = new X509CrlEntry(entry, isIndirect, previousCertificateIssuer); entrySet.Add(crlEntry); @@ -193,7 +192,7 @@ namespace Org.BouncyCastle.X509 public virtual X509CrlEntry GetRevokedCertificate( BigInteger serialNumber) { - IEnumerable certs = c.GetRevokedCertificateEnumeration(); + var certs = c.GetRevokedCertificateEnumeration(); X509Name previousCertificateIssuer = IssuerDN; foreach (CrlEntry entry in certs) @@ -211,14 +210,12 @@ namespace Org.BouncyCastle.X509 return null; } - public virtual ISet GetRevokedCertificates() + public virtual ISet<X509CrlEntry> GetRevokedCertificates() { - ISet entrySet = LoadCrlEntries(); + var entrySet = LoadCrlEntries(); if (entrySet.Count > 0) - { - return entrySet; // TODO? Collections.unmodifiableSet(entrySet); - } + return entrySet; return null; } @@ -339,7 +336,7 @@ namespace Org.BouncyCastle.X509 if (extensions != null) { - IEnumerator e = extensions.ExtensionOids.GetEnumerator(); + var e = extensions.ExtensionOids.GetEnumerator(); if (e.MoveNext()) { @@ -348,7 +345,7 @@ namespace Org.BouncyCastle.X509 do { - DerObjectIdentifier oid = (DerObjectIdentifier) e.Current; + DerObjectIdentifier oid = e.Current; X509Extension ext = extensions.GetExtension(oid); if (ext.Value != null) @@ -404,7 +401,7 @@ namespace Org.BouncyCastle.X509 while (e.MoveNext()); } - ISet certSet = GetRevokedCertificates(); + var certSet = GetRevokedCertificates(); if (certSet != null) { foreach (X509CrlEntry entry in certSet) |