public final class Attribute extends java.lang.Object implements java.io.Serializable, DerEncoder
Attribute ::= SEQUENCE { type AttributeType, value SET OF AttributeValue -- at least one value is required --} AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANYRefer to draft-ietf-pkix-ipki-part1-11 for the support attributes listed on page 96 of the internet draft. The are listed here for easy reference: name, common name, surname, given name, initials, generation qualifier, dn qualifier, country name, locality name, state or province name, organization name, organization unit name, title, pkcs9 email. Not all the attributes are supported. Please check the X500NameAttrMap for defined attributes.
Modifier and Type | Field and Description |
---|---|
protected X500NameAttrMap |
attrMap |
Constructor and Description |
---|
Attribute(DerValue val)
Construct an attribute from a der encoded object.
|
Attribute(ObjectIdentifier oid,
java.lang.String value)
Construct an attribute from attribute type and attribute value
|
Attribute(ObjectIdentifier oid,
java.util.Vector<java.lang.String> values)
Construct an attribute from attribute type and attribute values
|
Attribute(java.lang.String attr,
java.util.Vector<java.lang.String> values)
Construct an attribute from attribute type and attribute values
|
Modifier and Type | Method and Description |
---|---|
void |
derEncode(java.io.OutputStream out)
DER encode this object onto an output stream.
|
void |
encode(DerOutputStream out)
Encodes the Attribute to a Der output stream.
|
ObjectIdentifier |
getOid()
Returns the OID in the Attribute.
|
java.util.Enumeration<java.lang.String> |
getValues()
Returns enumeration of values in this attribute.
|
java.lang.String |
toString()
Prints a string version of this extension.
|
protected transient X500NameAttrMap attrMap
public Attribute(ObjectIdentifier oid, java.lang.String value) throws java.io.IOException
oid
- the object identifier of the attribute typevalue
- the value stringjava.io.IOException
public Attribute(ObjectIdentifier oid, java.util.Vector<java.lang.String> values) throws java.io.IOException
oid
- the object identifier of the attribute typevalues
- String value vectorjava.io.IOException
public Attribute(java.lang.String attr, java.util.Vector<java.lang.String> values) throws java.io.IOException
attr
- oid attribute type string CN,OU,O,C,L,TITLE,ST,STREET,UID,MAIL,E,DCvalues
- String value vectorjava.io.IOException
public Attribute(DerValue val) throws java.io.IOException
val
- the attribute object in der encode form.java.io.IOException
public ObjectIdentifier getOid()
public java.util.Enumeration<java.lang.String> getValues()
public void encode(DerOutputStream out) throws java.io.IOException
out
- The Der output stream.java.io.IOException
public void derEncode(java.io.OutputStream out) throws java.io.IOException
DerEncoder
interface.derEncode
in interface DerEncoder
out
- the output stream on which to write the DER encoding.java.io.IOException
- on encoding error.public java.lang.String toString()
toString
in class java.lang.Object