/**
		 * Produce an object suitable for an Asn1OutputStream.
		 *
		 * Returns:
		 *
		 * <pre>
		 *      SubjectDirectoryAttributes ::= Attributes
		 *      Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
		 *      Attribute ::= SEQUENCE
		 *      {
		 *        type AttributeType
		 *        values SET OF AttributeValue
		 *      }
		 *
		 *      AttributeType ::= OBJECT IDENTIFIER
		 *      AttributeValue ::= ANY DEFINED BY AttributeType
		 * </pre>
		 *
		 * @return a DERObject
		 */
		public override Asn1Object ToAsn1Object()
		{
            AttributeX509[] v = new AttributeX509[attributes.Count];
            for (int i = 0; i < attributes.Count; ++i)
            {
                v[i] = (AttributeX509)attributes[i];
            }
            return new DerSequence(v);
		}
 /**
  * @param attribute
  */
 public void AddAttribute(AttributeX509 attribute)
 {
     attributes.Add(attribute);
 }
예제 #3
0
		/**
		 * @param at an object representing an attribute.
		 */
		internal X509Attribute(
			Asn1Encodable at)
		{
			this.attr = AttributeX509.GetInstance(at);
		}
예제 #4
0
		/**
		 * Create an X.59 Attribute with the type given by the passed in oid and the
		 * value represented by an ASN.1 Set containing the objects in value.
		 *
		 * @param oid type of the attribute
		 * @param value vector of values to go in the attribute's value set.
		 */
		public X509Attribute(
			string              oid,
			Asn1EncodableVector value)
		{
			this.attr = new AttributeX509(new DerObjectIdentifier(oid), new DerSet(value));
		}
예제 #5
0
 /**
  * @param attribute
  */
 public void AddAttribute(AttributeX509 attribute)
 {
     attributes.Add(attribute);
 }