diff options
Diffstat (limited to 'crypto/src/asn1/x509/TBSCertList.cs')
-rw-r--r-- | crypto/src/asn1/x509/TBSCertList.cs | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/crypto/src/asn1/x509/TBSCertList.cs b/crypto/src/asn1/x509/TBSCertList.cs index a427ba2ba..aef41d440 100644 --- a/crypto/src/asn1/x509/TBSCertList.cs +++ b/crypto/src/asn1/x509/TBSCertList.cs @@ -1,8 +1,7 @@ using System; -using System.Collections; +using System.Collections.Generic; using Org.BouncyCastle.Utilities; -using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.X509 { @@ -14,13 +13,10 @@ namespace Org.BouncyCastle.Asn1.X509 internal Time revocationDate; internal X509Extensions crlEntryExtensions; - public CrlEntry( - Asn1Sequence seq) + public CrlEntry(Asn1Sequence seq) { if (seq.Count < 2 || seq.Count > 3) - { throw new ArgumentException("Bad sequence size: " + seq.Count); - } this.seq = seq; @@ -82,32 +78,39 @@ namespace Org.BouncyCastle.Asn1.X509 : Asn1Encodable { private class RevokedCertificatesEnumeration - : IEnumerable + : IEnumerable<CrlEntry> { - private readonly IEnumerable en; + private readonly IEnumerable<Asn1Encodable> en; - internal RevokedCertificatesEnumeration( - IEnumerable en) + internal RevokedCertificatesEnumeration(IEnumerable<Asn1Encodable> en) { this.en = en; } - public IEnumerator GetEnumerator() + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public IEnumerator<CrlEntry> GetEnumerator() { return new RevokedCertificatesEnumerator(en.GetEnumerator()); } private class RevokedCertificatesEnumerator - : IEnumerator + : IEnumerator<CrlEntry> { - private readonly IEnumerator e; + private readonly IEnumerator<Asn1Encodable> e; - internal RevokedCertificatesEnumerator( - IEnumerator e) + internal RevokedCertificatesEnumerator(IEnumerator<Asn1Encodable> e) { this.e = e; } + public virtual void Dispose() + { + } + public bool MoveNext() { return e.MoveNext(); @@ -118,7 +121,12 @@ namespace Org.BouncyCastle.Asn1.X509 e.Reset(); } - public object Current + object System.Collections.IEnumerator.Current + { + get { return Current; } + } + + public CrlEntry Current { get { return new CrlEntry(Asn1Sequence.GetInstance(e.Current)); } } @@ -252,11 +260,13 @@ namespace Org.BouncyCastle.Asn1.X509 return entries; } - public IEnumerable GetRevokedCertificateEnumeration() + public IEnumerable<CrlEntry> GetRevokedCertificateEnumeration() { if (revokedCertificates == null) { - return EmptyEnumerable.Instance; + // TODO + //return EmptyEnumerable.Instance; + return new List<CrlEntry>(0); } return new RevokedCertificatesEnumeration(revokedCertificates); |