summary refs log tree commit diff
path: root/crypto/src/asn1/ess/SigningCertificateV2.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/ess/SigningCertificateV2.cs')
-rw-r--r--crypto/src/asn1/ess/SigningCertificateV2.cs17
1 files changed, 2 insertions, 15 deletions
diff --git a/crypto/src/asn1/ess/SigningCertificateV2.cs b/crypto/src/asn1/ess/SigningCertificateV2.cs
index 4694098dd..557bede9c 100644
--- a/crypto/src/asn1/ess/SigningCertificateV2.cs
+++ b/crypto/src/asn1/ess/SigningCertificateV2.cs
@@ -65,25 +65,12 @@ namespace Org.BouncyCastle.Asn1.Ess
 
         public EssCertIDv2[] GetCerts()
         {
-            EssCertIDv2[] certIds = new EssCertIDv2[certs.Count];
-            for (int i = 0; i != certs.Count; i++)
-            {
-                certIds[i] = EssCertIDv2.GetInstance(certs[i]);
-            }
-            return certIds;
+            return certs.MapElements(EssCertIDv2.GetInstance);
         }
 
         public PolicyInformation[] GetPolicies()
         {
-            if (policies == null)
-                return null;
-
-            PolicyInformation[] policyInformations = new PolicyInformation[policies.Count];
-            for (int i = 0; i != policies.Count; i++)
-            {
-                policyInformations[i] = PolicyInformation.GetInstance(policies[i]);
-            }
-            return policyInformations;
+            return policies?.MapElements(PolicyInformation.GetInstance);
         }
 
         /**