APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.pkcs10

public Class PKCS10Attribute

extends Object
implements DerEncoder
Class Inheritance
All Implemented Interfaces
sun.security.util.DerEncoder
Imports
java.io.IOException, sun.security.pkcs.PKCS9Attribute, sun.security.util.*

Represent a PKCS#10 Attribute.

Attributes are additional 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
Authors
Amit Kapoor, Hemma Prafullchandra

Field Summary

Modifier and TypeField and Description
protected ObjectIdentifier
protected Object

Constructor Summary

AccessConstructor and Description
public
PKCS10Attribute(DerValue
the der encoded attribute.
derVal
)

Constructs an attribute from a DER encoding.

public
PKCS10Attribute(ObjectIdentifier
the ObjectIdentifier of the attribute.
attributeId
,
Object
an instance of a class that implements the attribute identified by the ObjectIdentifier.
attributeValue
)

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

public
PKCS10Attribute(PKCS9Attribute
the PKCS9Attribute to create from.
attr
)

Constructs an attribute from PKCS9 attribute.

Method Summary

Modifier and TypeMethod and Description
public void
encode(DerOutputStream
the DerOutputStream on which to write the DER encoding.
out
)

Implements sun.security.util.DerEncoder.encode.

DER encode this object onto an output stream.

public ObjectIdentifier
getAttributeId()

Returns the ObjectIdentifier of the attribute.

public Object
getAttributeValue()

Returns the attribute value.

public String
toString()

Overrides java.lang.Object.toString.

Returns the attribute in user readable form.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attributeIdback to summary
protected ObjectIdentifier attributeId
attributeValueback to summary
protected Object attributeValue

Constructor Detail

PKCS10Attributeback to summary
public PKCS10Attribute(DerValue derVal) throws IOException

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:DerValue

the der encoded attribute.

Exceptions
IOException:
on parsing errors.
PKCS10Attributeback to summary
public PKCS10Attribute(ObjectIdentifier attributeId, Object attributeValue)

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

Parameters
attributeId:ObjectIdentifier

the ObjectIdentifier of the attribute.

attributeValue:Object

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

PKCS10Attributeback to summary
public PKCS10Attribute(PKCS9Attribute attr)

Constructs an attribute from PKCS9 attribute.

Parameters
attr:PKCS9Attribute

the PKCS9Attribute to create from.

Method Detail

encodeback to summary
public void encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

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

Parameters
out:DerOutputStream

the DerOutputStream on which to write the DER encoding.

Annotations
@Override
getAttributeIdback to summary
public ObjectIdentifier getAttributeId()

Returns the ObjectIdentifier of the attribute.

getAttributeValueback to summary
public Object getAttributeValue()

Returns the attribute value.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the attribute in user readable form.