summary refs log tree commit diff
path: root/crypto/src/asn1/x509/NameConstraints.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/x509/NameConstraints.cs')
-rw-r--r--crypto/src/asn1/x509/NameConstraints.cs10
1 files changed, 3 insertions, 7 deletions
diff --git a/crypto/src/asn1/x509/NameConstraints.cs b/crypto/src/asn1/x509/NameConstraints.cs
index 9fe4fdd01..590b14aa0 100644
--- a/crypto/src/asn1/x509/NameConstraints.cs
+++ b/crypto/src/asn1/x509/NameConstraints.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 
 using Org.BouncyCastle.Utilities;
 
@@ -68,12 +69,7 @@ namespace Org.BouncyCastle.Asn1.X509
 
 		private DerSequence CreateSequence(IList<GeneralSubtree> subtrees)
 		{
-            GeneralSubtree[] gsts = new GeneralSubtree[subtrees.Count];
-            for (int i = 0; i < subtrees.Count; ++i)
-            {
-                gsts[i] = subtrees[i];
-            }
-            return new DerSequence(gsts);
+            return new DerSequence(subtrees.ToArray());
 		}
 
 		public Asn1Sequence PermittedSubtrees
@@ -92,7 +88,7 @@ namespace Org.BouncyCastle.Asn1.X509
 		 */
         public override Asn1Object ToAsn1Object()
         {
-            Asn1EncodableVector v = new Asn1EncodableVector();
+            Asn1EncodableVector v = new Asn1EncodableVector(2);
             v.AddOptionalTagged(false, 0, permitted);
             v.AddOptionalTagged(false, 1, excluded);
             return new DerSequence(v);