Class PKCS10Attribute
java.lang.Object
org.mozilla.jss.netscape.security.pkcs.PKCS10Attribute
- All Implemented Interfaces:
Serializable
,DerEncoder
Represent a PKCS Attribute.
Attributes are addiitonal attributes which can be inserted in a PKCS certificate request. For example a "Driving License Certificate" could have the driving license number as a attribute.
Attributes are represented as a sequence of the attribute identifier (Object Identifier) and a set of DER encoded attribute values. The current implementation only supports one value per attribute. ASN.1 definition of Attribute:
Attribute :: SEQUENCE { type AttributeValue, values SET OF AttributeValue } AttributeValue ::= ANY
- Version:
- 1.13
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ObjectIdentifier
protected CertAttrSet
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Constructs an attribute from another attribute.PKCS10Attribute
(DerValue derVal) Constructs an attribute from a DER encoded array of bytes.PKCS10Attribute
(ObjectIdentifier attributeId, CertAttrSet attributeValue) Constructs an attribute from individual components of ObjectIdentifier and the DER encoded value. -
Method Summary
Modifier and TypeMethodDescriptionvoid
derEncode
(OutputStream out) DER encode this object onto an output stream.void
encode
(OutputStream out) Write the output to the DerOutputStream.Returns the ObjectIdentifier of the attribute.Returns the attribute value as an byte array for further processing.toString()
Returns the attribute in user readable form.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
attributeId
-
attributeValue
-
-
Constructor Details
-
PKCS10Attribute
public PKCS10Attribute()Default constructor. Used only by sub-classes. -
PKCS10Attribute
Constructs an attribute from a DER encoded array of bytes.- Throws:
IOException
-
PKCS10Attribute
Constructs an attribute from individual components of ObjectIdentifier and the DER encoded value.- Parameters:
attributeId
- the ObjectIdentifier of the attribute.attributeValue
- the CertAttrSet.
-
PKCS10Attribute
Constructs an attribute from another attribute. To be used for creating decoded subclasses.- Parameters:
attr
- the attribute to create from.
-
-
Method Details
-
encode
Write the output to the DerOutputStream.- Parameters:
out
- the OutputStream to write the attribute to.- Throws:
CertificateException
- on certificate encoding errors.IOException
- on encoding errors.
-
derEncode
DER encode this object onto an output stream. Implements theDerEncoder
interface.- Specified by:
derEncode
in interfaceDerEncoder
- Parameters:
out
- the OutputStream on which to write the DER encoding.- Throws:
IOException
- on encoding errors.
-
getAttributeId
Returns the ObjectIdentifier of the attribute. -
getAttributeValue
Returns the attribute value as an byte array for further processing. -
toString
Returns the attribute in user readable form.
-