/** * @param at an object representing an attribute. */ X509Attribute( ASN1Encodable at) { this.attr = Attribute.getInstance(at); }
/** * @param at an object representing an attribute. */ X509Attribute( ASN1Encodable at) { this.attr = Attribute.getInstance(at); }
/** * add an attribute */ public void addAttribute( X509Attribute attribute) { acInfoGen.addAttribute(Attribute.getInstance(attribute.toASN1Object())); }
/** * Constructor from ASN1Sequence. * * The sequence is of type SubjectDirectoryAttributes: * * <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> * * @param seq * The ASN.1 sequence. */ private SubjectDirectoryAttributes(ASN1Sequence seq) { Enumeration e = seq.getObjects(); while (e.hasMoreElements()) { ASN1Sequence s = ASN1Sequence.getInstance(e.nextElement()); attributes.addElement(Attribute.getInstance(s)); } }
/** * Constructor from ASN1Sequence. * * The sequence is of type SubjectDirectoryAttributes: * * <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> * * @param seq * The ASN.1 sequence. */ private SubjectDirectoryAttributes(ASN1Sequence seq) { Enumeration e = seq.getObjects(); while (e.hasMoreElements()) { ASN1Sequence s = ASN1Sequence.getInstance(e.nextElement()); attributes.addElement(Attribute.getInstance(s)); } }
/** * Return an array of attributes matching the passed in type OID. * * @param type the type of the attribute being looked for. * @return an array of Attribute of the requested type, zero length if none present. */ public Attribute[] getAttributes(ASN1ObjectIdentifier type) { ASN1Sequence seq = attrCert.getAcinfo().getAttributes(); List list = new ArrayList(); for (int i = 0; i != seq.size(); i++) { Attribute attr = Attribute.getInstance(seq.getObjectAt(i)); if (attr.getAttrType().equals(type)) { list.add(attr); } } if (list.size() == 0) { return EMPTY_ARRAY; } return (Attribute[])list.toArray(new Attribute[list.size()]); }
/** * Return an array of attributes matching the passed in type OID. * * @param type the type of the attribute being looked for. * @return an array of Attribute of the requested type, zero length if none present. */ public Attribute[] getAttributes(ASN1ObjectIdentifier type) { ASN1Sequence seq = attrCert.getAcinfo().getAttributes(); List list = new ArrayList(); for (int i = 0; i != seq.size(); i++) { Attribute attr = Attribute.getInstance(seq.getObjectAt(i)); if (attr.getAttrType().equals(type)) { list.add(attr); } } if (list.size() == 0) { return EMPTY_ARRAY; } return (Attribute[])list.toArray(new Attribute[list.size()]); }
/** * Return the attributes, if any associated with this request. * * @return an array of Attribute, zero length if none present. */ public Attribute[] getAttributes() { ASN1Sequence seq = attrCert.getAcinfo().getAttributes(); Attribute[] attrs = new Attribute[seq.size()]; for (int i = 0; i != seq.size(); i++) { attrs[i] = Attribute.getInstance(seq.getObjectAt(i)); } return attrs; }
/** * Return the attributes, if any associated with this request. * * @return an array of Attribute, zero length if none present. */ public Attribute[] getAttributes() { ASN1Sequence seq = attrCert.getAcinfo().getAttributes(); Attribute[] attrs = new Attribute[seq.size()]; for (int i = 0; i != seq.size(); i++) { attrs[i] = Attribute.getInstance(seq.getObjectAt(i)); } return attrs; }
private SignerAttribute( ASN1Sequence seq) { int index = 0; values = new Object[seq.size()]; for (Enumeration e = seq.getObjects(); e.hasMoreElements();) { ASN1TaggedObject taggedObject = ASN1TaggedObject.getInstance(e.nextElement()); if (taggedObject.getTagNo() == 0) { ASN1Sequence attrs = ASN1Sequence.getInstance(taggedObject, true); Attribute[] attributes = new Attribute[attrs.size()]; for (int i = 0; i != attributes.length; i++) { attributes[i] = Attribute.getInstance(attrs.getObjectAt(i)); } values[index] = attributes; } else if (taggedObject.getTagNo() == 1) { values[index] = AttributeCertificate.getInstance(ASN1Sequence.getInstance(taggedObject, true)); } else { throw new IllegalArgumentException("illegal tag: " + taggedObject.getTagNo()); } index++; } }
private SignerAttribute( ASN1Sequence seq) { int index = 0; values = new Object[seq.size()]; for (Enumeration e = seq.getObjects(); e.hasMoreElements();) { ASN1TaggedObject taggedObject = ASN1TaggedObject.getInstance(e.nextElement()); if (taggedObject.getTagNo() == 0) { ASN1Sequence attrs = ASN1Sequence.getInstance(taggedObject, true); Attribute[] attributes = new Attribute[attrs.size()]; for (int i = 0; i != attributes.length; i++) { attributes[i] = Attribute.getInstance(attrs.getObjectAt(i)); } values[index] = attributes; } else if (taggedObject.getTagNo() == 1) { values[index] = AttributeCertificate.getInstance(ASN1Sequence.getInstance(taggedObject, true)); } else { throw new IllegalArgumentException("illegal tag: " + taggedObject.getTagNo()); } index++; } }