public final class PKCS12Attribute extends Objectimplements KeyStore .Entry .Attribute
| Constructor and Description |
|---|
PKCS12Attribute(byte[] encoded)
Constructs a PKCS12 attribute from its ASN.1 DER encoding.
|
PKCS12Attribute(String
Constructs a PKCS12 attribute from its name and value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object
Compares this
PKCS12Attribute and a specified object for equality.
|
byte[] |
getEncoded()
Returns the attribute's ASN.1 DER encoding.
|
String |
getName()
Returns the attribute's ASN.1 Object Identifier represented as a list of dot-separated integers.
|
String |
getValue()
Returns the attribute's ASN.1 DER-encoded value as a string.
|
int |
hashCode()
Returns the hashcode for this
PKCS12Attribute.
|
String |
toString()
Returns a string representation of this
PKCS12Attribute.
|
public PKCS12Attribute(Stringname, String value)
Arrays.toString(java.lang.Object[]) .
A string value will be DER-encoded as an ASN.1 UTF8String and a binary value will be DER-encoded as an ASN.1 Octet String.
name - the attribute's identifier
value - the attribute's value
NullPointerException - if
name or
value is
null
IllegalArgumentException - if
name or
value is incorrectly formatted
public PKCS12Attribute(byte[] encoded)
Attribute ::= SEQUENCE {
type AttributeType,
values SET OF AttributeValue
}
AttributeType ::= OBJECT IDENTIFIER
AttributeValue ::= ANY defined by type
encoded - the attribute's ASN.1 DER encoding. It is cloned to prevent subsequent modificaion.
NullPointerException - if
encoded is
null
IllegalArgumentException - if
encoded is incorrectly formatted
public StringgetName()
getName in interface
KeyStore.Entry.Attribute
public StringgetValue()
String formats:
Arrays.toString(java.lang.Object[]) .
getValue in interface
KeyStore.Entry.Attribute
public byte[] getEncoded()
public boolean equals(Objectobj)
PKCS12Attribute and a specified object for equality.
equals in class
Object
obj - the comparison object
obj is a
PKCS12Attribute and their DER encodings are equal.
Object.hashCode() ,
HashMap
public int hashCode()
PKCS12Attribute. The hash code is computed from its DER encoding.
hashCode in class
Object
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)