summary refs log tree commit diff
path: root/crypto/src/asn1/cms/AttributeTable.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/cms/AttributeTable.cs')
-rw-r--r--crypto/src/asn1/cms/AttributeTable.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/crypto/src/asn1/cms/AttributeTable.cs b/crypto/src/asn1/cms/AttributeTable.cs
index aa312a13f..fc6d3cabc 100644
--- a/crypto/src/asn1/cms/AttributeTable.cs
+++ b/crypto/src/asn1/cms/AttributeTable.cs
@@ -1,8 +1,6 @@
 using System;
 using System.Collections.Generic;
 
-using Org.BouncyCastle.Utilities;
-
 namespace Org.BouncyCastle.Asn1.Cms
 {
     public class AttributeTable
@@ -180,14 +178,28 @@ namespace Org.BouncyCastle.Asn1.Cms
 			return new Attributes(ToAsn1EncodableVector());
 		}
 
-		/**
+        public AttributeTable Add(params Attribute[] attributes)
+        {
+            if (attributes == null || attributes.Length < 1)
+                return this;
+
+            var newTable = new AttributeTable(m_attributes);
+            foreach (Attribute attribute in attributes)
+            {
+                newTable.AddAttribute(attribute);
+            }
+
+            return newTable;
+        }
+
+        /**
 		 * Return a new table with the passed in attribute added.
 		 *
 		 * @param attrType
 		 * @param attrValue
 		 * @return
 		 */
-		public AttributeTable Add(DerObjectIdentifier attrType, Asn1Encodable attrValue)
+        public AttributeTable Add(DerObjectIdentifier attrType, Asn1Encodable attrValue)
 		{
 			AttributeTable newTable = new AttributeTable(m_attributes);