summary refs log tree commit diff
path: root/crypto/src/x509/X509V2AttributeCertificate.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/x509/X509V2AttributeCertificate.cs')
-rw-r--r--crypto/src/x509/X509V2AttributeCertificate.cs18
1 files changed, 5 insertions, 13 deletions
diff --git a/crypto/src/x509/X509V2AttributeCertificate.cs b/crypto/src/x509/X509V2AttributeCertificate.cs
index 980b9f3d5..84bf0db54 100644
--- a/crypto/src/x509/X509V2AttributeCertificate.cs
+++ b/crypto/src/x509/X509V2AttributeCertificate.cs
@@ -214,20 +214,12 @@ namespace Org.BouncyCastle.X509
 			return cert.ACInfo.Extensions;
 		}
 
-		public virtual X509Attribute[] GetAttributes()
-		{
-			Asn1Sequence seq = cert.ACInfo.Attributes;
-			X509Attribute[] attrs = new X509Attribute[seq.Count];
-
-			for (int i = 0; i != seq.Count; i++)
-			{
-				attrs[i] = new X509Attribute((Asn1Encodable)seq[i]);
-			}
-
-			return attrs;
-		}
+        public virtual X509Attribute[] GetAttributes()
+        {
+            return cert.ACInfo.Attributes.MapElements(element => new X509Attribute(element));
+        }
 
-		public virtual X509Attribute[] GetAttributes(
+        public virtual X509Attribute[] GetAttributes(
 			string oid)
 		{
 			Asn1Sequence seq = cert.ACInfo.Attributes;