summary refs log tree commit diff
path: root/crypto/src/cms/CMSUtils.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/cms/CMSUtils.cs')
-rw-r--r--crypto/src/cms/CMSUtils.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/crypto/src/cms/CMSUtils.cs b/crypto/src/cms/CMSUtils.cs
index aa25870e6..281e1e73a 100644
--- a/crypto/src/cms/CMSUtils.cs
+++ b/crypto/src/cms/CMSUtils.cs
@@ -12,7 +12,7 @@ using Org.BouncyCastle.X509;
 
 namespace Org.BouncyCastle.Cms
 {
-    internal class CmsUtilities
+	internal static class CmsUtilities
     {
 		// TODO Is there a .NET equivalent to this?
 //		private static readonly Runtime RUNTIME = Runtime.getRuntime();
@@ -161,7 +161,7 @@ namespace Org.BouncyCastle.Cms
 				v.Add(element);
 			}
 
-			return new BerSet(v);
+			return BerSet.FromVector(v);
 		}
 
 		internal static Asn1Set CreateDerSetFromList(IEnumerable<Asn1Encodable> elements)
@@ -173,7 +173,7 @@ namespace Org.BouncyCastle.Cms
 				v.Add(element);
 			}
 
-			return new DerSet(v);
+            return DerSet.FromVector(v);
 		}
 
 		internal static TbsCertificateStructure GetTbsCertificateStructure(X509Certificate cert)
@@ -187,6 +187,21 @@ namespace Org.BouncyCastle.Cms
 			return new IssuerAndSerialNumber(tbsCert.Issuer, tbsCert.SerialNumber.Value);
 		}
 
+        internal static Asn1.Cms.AttributeTable ParseAttributeTable(Asn1SetParser parser)
+        {
+            Asn1EncodableVector v = new Asn1EncodableVector();
+
+            IAsn1Convertible o;
+            while ((o = parser.ReadObject()) != null)
+            {
+                Asn1SequenceParser seq = (Asn1SequenceParser)o;
+
+                v.Add(seq.ToAsn1Object());
+            }
+
+            return new Asn1.Cms.AttributeTable(new DerSet(v));
+        }
+
         internal static void ValidateOtherRevocationInfo(OtherRevocationInfoFormat otherRevocationInfo)
         {
             if (CmsObjectIdentifiers.id_ri_ocsp_response.Equals(otherRevocationInfo.InfoFormat))