|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.pkcs.pkcs12.Attributes
This class implements attributes of SafeBags as defined in PKCS#12. At this time the following attributes are implemented:
The ASN.1 definition looks like:
Attributes ::= SET OF Attribute -- from X.501
-- in pre-1994 ASN.1, Attribute looks like: -- Attribute ::= SEQUENCE { -- type OBJECT IDENTIFIER, -- values SET OF ANY DEFINED BY type }
FriendlyName ::= BMPString -- a friendlyName has a single attr. value LocalKeyID ::= OCTET STRING -- a localKeyID has a single attr.value
SafeBag
,
CertificateBag
,
KeyBag
Constructor Summary | |
Attributes()
Creates empty attributes. |
|
Attributes(String friendlyName,
byte[] localKeyID)
Creates new Attributes from a friendly name and a local key ID. |
Method Summary | |
Attribute[] |
getAttributes()
Returns the attributes of this SafeBag object or
null if there are no attributes. |
String |
getFriendlyName()
Returns the fiendly name attribute. |
byte[] |
getLocalKeyID()
Returns the local key ID attribute. |
protected void |
setAttributes(Attribute[] attributes)
Set the (optional) attributes for this SafeBag. |
void |
setFriendlyName(String friendlyName)
Sets the friendly name attribute. |
void |
setLocalKeyID(byte[] localKeyID)
Sets the local key ID attribute. |
String |
toString()
Returns a String representation of these Attributes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Attributes()
public Attributes(String friendlyName, byte[] localKeyID)
Method Detail |
public void setFriendlyName(String friendlyName)
public void setLocalKeyID(byte[] localKeyID)
public String getFriendlyName()
public byte[] getLocalKeyID()
protected void setAttributes(Attribute[] attributes)
For instance:
byte[] loc_key_id = {0x01, 0x00, 0x00, 0x00}; Attribute[] attributes = new Attribute[2]; ASN1Object[] localKeyId = {new OCTET_STRING(loc_key_id)}; ASN1Object[] friendlyName = {new BMPString("This is a friendly name")}; attributes[0] = new Attribute(ObjectID.friendlyName, friendlyName); attributes[1] = new Attribute(ObjectID.localKeyID, localKeyId); safe_bag.setAttributes(attributes);
attributes
- the attributes, as array of
iaik.asn1.structures.Attribute
Attribute
public Attribute[] getAttributes()
SafeBag
object or
null
if there are no attributes.SafeBag
, or null
if there are no attributes includedsetAttributes(iaik.asn1.structures.Attribute[])
public String toString()
toString
in class Object
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |