public class PKCS10Attribute extends java.lang.Object implements DerEncoder, java.io.Serializable
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
Modifier and Type | Field and Description |
---|---|
protected ObjectIdentifier |
attributeId |
protected CertAttrSet |
attributeValue |
Constructor and Description |
---|
PKCS10Attribute()
Default constructor.
|
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.
|
PKCS10Attribute(PKCS10Attribute attr)
Constructs an attribute from another attribute.
|
Modifier and Type | Method and Description |
---|---|
void |
derEncode(java.io.OutputStream out)
DER encode this object onto an output stream.
|
void |
encode(java.io.OutputStream out)
Write the output to the DerOutputStream.
|
ObjectIdentifier |
getAttributeId()
Returns the ObjectIdentifier of the attribute.
|
CertAttrSet |
getAttributeValue()
Returns the attribute value as an byte array for further processing.
|
java.lang.String |
toString()
Returns the attribute in user readable form.
|
protected ObjectIdentifier attributeId
protected CertAttrSet attributeValue
public PKCS10Attribute()
public PKCS10Attribute(DerValue derVal) throws java.io.IOException
java.io.IOException
public PKCS10Attribute(ObjectIdentifier attributeId, CertAttrSet attributeValue)
attributeId
- the ObjectIdentifier of the attribute.attributeValue
- the CertAttrSet.public PKCS10Attribute(PKCS10Attribute attr)
attr
- the attribute to create from.public void encode(java.io.OutputStream out) throws java.security.cert.CertificateException, java.io.IOException
out
- the OutputStream to write the attribute to.java.security.cert.CertificateException
- on certificate encoding errors.java.io.IOException
- on encoding errors.public void derEncode(java.io.OutputStream out) throws java.io.IOException
DerEncoder
interface.derEncode
in interface DerEncoder
out
- the OutputStream on which to write the DER encoding.java.io.IOException
- on encoding errors.public ObjectIdentifier getAttributeId()
public CertAttrSet getAttributeValue()
public java.lang.String toString()
toString
in class java.lang.Object