From 3b73fe21b3de97c0df89fe72109c8450b7242fa7 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 24 Jun 2022 12:47:51 +0700 Subject: Use generics instead of dynamic checks --- crypto/src/asn1/esf/OtherSigningCertificate.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'crypto/src/asn1/esf/OtherSigningCertificate.cs') diff --git a/crypto/src/asn1/esf/OtherSigningCertificate.cs b/crypto/src/asn1/esf/OtherSigningCertificate.cs index 2b6d646bc..a4f4a0727 100644 --- a/crypto/src/asn1/esf/OtherSigningCertificate.cs +++ b/crypto/src/asn1/esf/OtherSigningCertificate.cs @@ -1,9 +1,8 @@ using System; -using System.Collections; +using System.Collections.Generic; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Utilities; -using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf { @@ -74,28 +73,23 @@ namespace Org.BouncyCastle.Asn1.Esf } public OtherSigningCertificate( - IEnumerable certs) + IEnumerable certs) : this(certs, null) { } public OtherSigningCertificate( - IEnumerable certs, - IEnumerable policies) + IEnumerable certs, + IEnumerable policies) { if (certs == null) throw new ArgumentNullException("certs"); - if (!CollectionUtilities.CheckElementsAreOfType(certs, typeof(OtherCertID))) - throw new ArgumentException("Must contain only 'OtherCertID' objects", "certs"); this.certs = new DerSequence( Asn1EncodableVector.FromEnumerable(certs)); if (policies != null) { - if (!CollectionUtilities.CheckElementsAreOfType(policies, typeof(PolicyInformation))) - throw new ArgumentException("Must contain only 'PolicyInformation' objects", "policies"); - this.policies = new DerSequence( Asn1EncodableVector.FromEnumerable(policies)); } -- cgit 1.4.1