|
||||||||||
| 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(java.lang.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. |
java.lang.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(java.lang.String friendlyName)
Sets the friendly name attribute. |
void |
setLocalKeyID(byte[] localKeyID)
Sets the local key ID attribute. |
java.lang.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(java.lang.String friendlyName,
byte[] localKeyID)
| Method Detail |
public void setFriendlyName(java.lang.String friendlyName)
public void setLocalKeyID(byte[] localKeyID)
public java.lang.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.AttributeAttributepublic 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 java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||