|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.ibm.security.pkcsutil.PKCSAttribute
Represent an Attribute as defined in X.501.
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. They are also used to add information to the PrivateKeyInfo defined by PKCS #8.
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
PKCSAttribute objects are immutable; they cannot be changed once created.
Constructor Summary | |
PKCSAttribute(byte[] der)
Create a PKCSAttribute object with a DER byte array. |
|
PKCSAttribute(byte[] der,
String provider)
Create a PKCSAttribute object with a DER byte array. |
|
PKCSAttribute(ObjectIdentifier id,
Object value)
Constructs an attribute from individual components of ObjectIdentifier and the value (any Java object). |
|
PKCSAttribute(ObjectIdentifier id,
Object value,
String provider)
Constructs an attribute from individual components of ObjectIdentifier and the value (any Java object). |
|
PKCSAttribute(PKCS9DerObject attr)
Constructs an attribute from PKCS #9 attribute. |
|
PKCSAttribute(PKCS9DerObject attr,
String provider)
Constructs an attribute from PKCS #9 attribute. |
|
PKCSAttribute(String filename,
boolean base64)
Create a PKCSAttribute with the filename of the DER-encoded or BASE64-encoded object. |
|
PKCSAttribute(String filename,
boolean base64,
String provider)
Create a PKCSAttribute with the filename of the DER-encoded or BASE64-encoded object. |
|
PKCSAttribute(UnresolvedAttribute attr)
Constructs an attribute from a non-standard attribute. |
|
PKCSAttribute(UnresolvedAttribute attr,
String provider)
Constructs an attribute from a non-standard attribute. |
Method Summary | |
Object |
clone()
Creates a clone of this PKCSAttribute object. |
protected void |
decode(com.ibm.security.pkcsutil.DerValue encoding)
Initializes a PKCSAttribute object from a DerValue. |
void |
derEncode(OutputStream out)
DER encode this object onto an output stream. |
void |
encode(OutputStream out)
Encode the attributes in DER form to the stream. |
boolean |
equals(Object obj)
Determines if this PKCSAttribute object is equivalent to the input object. |
ObjectIdentifier |
getAttributeId()
Returns a reference to the ObjectIdentifier of the attribute. |
Object |
getAttributeValue()
Returns a copy of the attribute value. |
PKCS9DerObject |
getPKCS9DerObject()
Returns a PKCS9DerObject based on the PKCSAttribute value. |
String |
toString()
Returns the attribute in user readable form. |
Constructor Detail |
public PKCSAttribute(byte[] der) throws IOException
der
- a DER byte array of a PKCSAttribute object.public PKCSAttribute(byte[] der, String provider) throws IOException
der
- a DER byte array of a PKCSAttribute object.provider
- the provider to be used.public PKCSAttribute(ObjectIdentifier id, Object value) throws IOException
id
- the ObjectIdentifier of the attribute.value
- an instance of a class that implements the attribute
identified by the ObjectIdentifier. If the ObjectIdentifier is not
defined in PKCS #9, the value must be a byte array that is a SET OF
DER-encoding.public PKCSAttribute(ObjectIdentifier id, Object value, String provider) throws IOException
id
- the ObjectIdentifier of the attribute.value
- an instance of a class that implements the attribute
identified by the ObjectIdentifier. If the ObjectIdentifier is not
defined in PKCS #9, the value must be a byte array that is a SET OF
DER-encoding.provider
- the provider to be used.public PKCSAttribute(PKCS9DerObject attr)
attr
- the PKCSAttr to create from.public PKCSAttribute(PKCS9DerObject attr, String provider)
attr
- the PKCSAttr to create from.provider
- the provider to be used.public PKCSAttribute(UnresolvedAttribute attr) throws IOException
attr
- the non-standard to create from.public PKCSAttribute(UnresolvedAttribute attr, String provider) throws IOException
attr
- the non-standard to create from.provider
- the provider to be used.public PKCSAttribute(String filename, boolean base64) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedpublic PKCSAttribute(String filename, boolean base64, String provider) throws IOException
filename
- name of the DER-encoded or base64-encoded objectbase64
- true if BASE64-encoded, false if DER-encodedprovider
- the provider to be usedMethod Detail |
public Object clone()
public boolean equals(Object obj)
other
- the object to compare this one to.public void encode(OutputStream out) throws IOException
out
- the OutputStream to marshal the contents to.public void derEncode(OutputStream out) throws IOException
DerEncoder
interface.out
- the OutputStream on which to write the DER encoding.public ObjectIdentifier getAttributeId()
public Object getAttributeValue() throws IOException
public String toString()
public PKCS9DerObject getPKCS9DerObject()
protected void decode(com.ibm.security.pkcsutil.DerValue encoding) throws IOException
encoding
- a DER-encoded PKCSAttribute object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |