summary refs log tree commit diff
path: root/crypto/src/asn1/cms/AttributeTable.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 11:01:05 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-28 11:01:05 +0700
commit18c67ac1339c9ca4f3604f5e5d44da0263b9ad21 (patch)
tree32fe34fa1251ddb8c5529d9a39a31a68641dd257 /crypto/src/asn1/cms/AttributeTable.cs
parentGenerics migration in Bcpg, Bzip2, Cmp (diff)
downloadBouncyCastle.NET-ed25519-18c67ac1339c9ca4f3604f5e5d44da0263b9ad21.tar.xz
Generics migration in Cms
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);