Org.BouncyCastle.Asn1.Cms.AttributeTable.AddAttribute C# (CSharp) Method

AddAttribute() private method

private AddAttribute ( Attribute a ) : void
a Attribute
return void
		private void AddAttribute(
            Attribute a)
        {
			DerObjectIdentifier oid = a.AttrType;
            object obj = attributes[oid];

            if (obj == null)
            {
                attributes[oid] = a;
            }
            else
            {
                IList v;

                if (obj is Attribute)
                {
                    v = Platform.CreateArrayList();

                    v.Add(obj);
                    v.Add(a);
                }
                else
                {
                    v = (IList) obj;

                    v.Add(a);
                }

                attributes[oid] = v;
            }
        }

Usage Example

        public AttributeTable Add(DerObjectIdentifier attrType, Asn1Encodable attrValue)
        {
            AttributeTable attributeTable = new AttributeTable(this.attributes);

            attributeTable.AddAttribute(new Attribute(attrType, new DerSet(attrValue)));
            return(attributeTable);
        }
All Usage Examples Of Org.BouncyCastle.Asn1.Cms.AttributeTable::AddAttribute