Class Attribute
java.lang.Object
org.mozilla.jss.netscape.security.x509.Attribute
- All Implemented Interfaces:
Serializable
,DerEncoder
An attribute, as identified by some attribute ID, has some particular values.
Values are as a rule ASN.1 printable strings. A conventional set of type IDs
is recognized when parsing. The following shows the syntax:
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected X500NameAttrMap
(package private) ObjectIdentifier
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an attribute from attribute type and attribute valuesConstruct an attribute from a der encoded object.Attribute
(ObjectIdentifier oid, String value) Construct an attribute from attribute type and attribute valueAttribute
(ObjectIdentifier oid, Vector<String> values) Construct an attribute from attribute type and attribute values -
Method Summary
Modifier and TypeMethodDescriptionprivate void
decodeThis
(DerValue val) private void
decodeValueSet
(DerValue val) void
derEncode
(OutputStream out) DER encode this object onto an output stream.void
encode
(DerOutputStream out) Encodes the Attribute to a Der output stream.private void
encodeThis
(OutputStream out) private void
getOid()
Returns the OID in the Attribute.Returns enumeration of values in this attribute.toString()
Prints a string version of this extension.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
oid
ObjectIdentifier oid -
valueSet
-
attrMap
-
-
Constructor Details
-
Attribute
Construct an attribute from attribute type and attribute value- Parameters:
oid
- the object identifier of the attribute typevalue
- the value string- Throws:
IOException
-
Attribute
Construct an attribute from attribute type and attribute values- Parameters:
oid
- the object identifier of the attribute typevalues
- String value vector- Throws:
IOException
-
Attribute
Construct an attribute from attribute type and attribute values- Parameters:
attr
- oid attribute type string CN,OU,O,C,L,TITLE,ST,STREET,UID,MAIL,E,DCvalues
- String value vector- Throws:
IOException
-
Attribute
Construct an attribute from a der encoded object. This der der encoded value should represent the attribute object.- Parameters:
val
- the attribute object in der encode form.- Throws:
IOException
-
-
Method Details
-
getOid
Returns the OID in the Attribute.- Returns:
- the ObjectIdentifier in this Attribute.
-
getValues
Returns enumeration of values in this attribute.- Returns:
- Enumeration of values of this Attribute.
-
encode
Encodes the Attribute to a Der output stream. Attribute are encoded as a SEQUENCE of two elements.- Parameters:
out
- The Der output stream.- Throws:
IOException
-
derEncode
DER encode this object onto an output stream. Implements theDerEncoder
interface.- Specified by:
derEncode
in interfaceDerEncoder
- Parameters:
out
- the output stream on which to write the DER encoding.- Throws:
IOException
- on encoding error.
-
toString
Prints a string version of this extension. -
encodeThis
- Throws:
IOException
-
encodeValueSet
- Throws:
IOException
-
decodeThis
- Throws:
IOException
-
decodeValueSet
- Throws:
IOException
-