Class PKCS10Attribute
- java.lang.Object
-
- org.mozilla.jss.netscape.security.pkcs.PKCS10Attribute
-
- All Implemented Interfaces:
java.io.Serializable
,DerEncoder
public class PKCS10Attribute extends java.lang.Object implements DerEncoder, java.io.Serializable
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
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectIdentifier
attributeId
protected CertAttrSet
attributeValue
-
Constructor Summary
Constructors Constructor Description PKCS10Attribute()
Default constructor.PKCS10Attribute(PKCS10Attribute attr)
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
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
attributeId
protected ObjectIdentifier attributeId
-
attributeValue
protected CertAttrSet attributeValue
-
-
Constructor Detail
-
PKCS10Attribute
public PKCS10Attribute()
Default constructor. Used only by sub-classes.
-
PKCS10Attribute
public PKCS10Attribute(DerValue derVal) throws java.io.IOException
Constructs an attribute from a DER encoded array of bytes.- Throws:
java.io.IOException
-
PKCS10Attribute
public PKCS10Attribute(ObjectIdentifier attributeId, CertAttrSet attributeValue)
Constructs an attribute from individual components of ObjectIdentifier and the DER encoded value.- Parameters:
attributeId
- the ObjectIdentifier of the attribute.attributeValue
- the CertAttrSet.
-
PKCS10Attribute
public PKCS10Attribute(PKCS10Attribute attr)
Constructs an attribute from another attribute. To be used for creating decoded subclasses.- Parameters:
attr
- the attribute to create from.
-
-
Method Detail
-
encode
public void encode(java.io.OutputStream out) throws java.security.cert.CertificateException, java.io.IOException
Write the output to the DerOutputStream.- Parameters:
out
- the OutputStream to write the attribute to.- Throws:
java.security.cert.CertificateException
- on certificate encoding errors.java.io.IOException
- on encoding errors.
-
derEncode
public void derEncode(java.io.OutputStream out) throws java.io.IOException
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:
java.io.IOException
- on encoding errors.
-
getAttributeId
public ObjectIdentifier getAttributeId()
Returns the ObjectIdentifier of the attribute.
-
getAttributeValue
public CertAttrSet getAttributeValue()
Returns the attribute value as an byte array for further processing.
-
toString
public java.lang.String toString()
Returns the attribute in user readable form.- Overrides:
toString
in classjava.lang.Object
-
-