public class

PKCS10Attribute

extends Object
implements DerEncoder
java.lang.Object
   ↳ sun.security.pkcs.PKCS10Attribute

Class Overview

Represent a PKCS#10 Attribute.

Attributes are additonal information which can be inserted in a PKCS#10 certificate request. For example a "Driving License Certificate" could have the driving license number as an attribute.

Attributes are represented as a sequence of the attribute identifier (Object Identifier) and a set of DER encoded attribute values. ASN.1 definition of Attribute:

 Attribute :: SEQUENCE {
    type    AttributeType,
    values  SET OF AttributeValue
 }
 AttributeType  ::= OBJECT IDENTIFIER
 AttributeValue ::= ANY defined by type
 

Summary

Fields
protected ObjectIdentifier attributeId
protected Object attributeValue
Public Constructors
PKCS10Attribute(DerValue derVal)
Constructs an attribute from a DER encoding.
PKCS10Attribute(ObjectIdentifier attributeId, Object attributeValue)
Constructs an attribute from individual components of ObjectIdentifier and the value (any java object).
PKCS10Attribute(PKCS9Attribute attr)
Constructs an attribute from PKCS9 attribute.
Public Methods
void derEncode(OutputStream out)
DER encode this object onto an output stream.
ObjectIdentifier getAttributeId()
Returns the ObjectIdentifier of the attribute.
Object getAttributeValue()
Returns the attribute value.
String toString()
Returns the attribute in user readable form.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sun.security.util.DerEncoder

Fields

protected ObjectIdentifier attributeId

protected Object attributeValue

Public Constructors

public PKCS10Attribute (DerValue derVal)

Constructs an attribute from a DER encoding. This constructor expects the value to be encoded as defined above, i.e. a SEQUENCE of OID and SET OF value(s), not a literal X.509 v3 extension. Only PKCS9 defined attributes are supported currently.

Parameters
derVal the der encoded attribute.
Throws
IOException on parsing errors.

public PKCS10Attribute (ObjectIdentifier attributeId, Object attributeValue)

Constructs an attribute from individual components of ObjectIdentifier and the value (any java object).

Parameters
attributeId the ObjectIdentifier of the attribute.
attributeValue an instance of a class that implements the attribute identified by the ObjectIdentifier.

public PKCS10Attribute (PKCS9Attribute attr)

Constructs an attribute from PKCS9 attribute.

Parameters
attr the PKCS9Attribute to create from.

Public Methods

public void derEncode (OutputStream out)

DER encode this object onto an output stream. Implements the DerEncoder interface.

Parameters
out the OutputStream on which to write the DER encoding.
Throws
IOException on encoding errors.

public ObjectIdentifier getAttributeId ()

Returns the ObjectIdentifier of the attribute.

public Object getAttributeValue ()

Returns the attribute value.

public String toString ()

Returns the attribute in user readable form.

Returns
  • a string representation of the object.