diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-28 11:01:05 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-28 11:01:05 +0700 |
commit | 18c67ac1339c9ca4f3604f5e5d44da0263b9ad21 (patch) | |
tree | 32fe34fa1251ddb8c5529d9a39a31a68641dd257 /crypto/src/asn1 | |
parent | Generics migration in Bcpg, Bzip2, Cmp (diff) | |
download | BouncyCastle.NET-ed25519-18c67ac1339c9ca4f3604f5e5d44da0263b9ad21.tar.xz |
Generics migration in Cms
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r-- | crypto/src/asn1/cms/AttributeTable.cs | 20 |
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); |