Class PKCS12Attribute
java.lang.Object
java.security.PKCS12Attribute
- All Implemented Interfaces:
KeyStore.Entry.Attribute
An attribute associated with a PKCS12 keystore entry.
The attribute name is an ASN.1 Object Identifier and the attribute
value is a set of ASN.1 types.
- Since:
- 1.8
-
Constructor Summary
ConstructorsConstructorDescriptionPKCS12Attribute(byte[] encoded) Constructs a PKCS12 attribute from its ASN.1 DER encoding.PKCS12Attribute(String name, String value) Constructs a PKCS12 attribute from its name and value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares thisPKCS12Attributeand a specified object for equality.byte[]Returns the attribute's ASN.1 DER encoding.getName()Returns the attribute's ASN.1 Object Identifier represented as a list of dot-separated integers.getValue()Returns the attribute's ASN.1 DER-encoded value as a string.inthashCode()Returns the hashcode for thisPKCS12Attribute.toString()Returns a string representation of thisPKCS12Attribute.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
PKCS12Attribute
Constructs a PKCS12 attribute from its name and value. The name is an ASN.1 Object Identifier represented as a list of dot-separated integers. A string value is represented as the string itself. A binary value is represented as a string of colon-separated pairs of hexadecimal digits. Multivalued attributes are represented as a comma-separated list of values, enclosed in square brackets. SeeArrays.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.
- Parameters:
name- the attribute's identifiervalue- the attribute's value- Throws:
NullPointerException- ifnameorvalueisnullIllegalArgumentException- ifnameorvalueis incorrectly formatted
-
PKCS12Attribute
public PKCS12Attribute(byte[] encoded) Constructs a PKCS12 attribute from its ASN.1 DER encoding. The DER encoding is specified by the following ASN.1 definition:Attribute ::= SEQUENCE { type AttributeType, values SET OF AttributeValue } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY defined by type- Parameters:
encoded- the attribute's ASN.1 DER encoding. It is cloned to prevent subsequent modification.- Throws:
NullPointerException- ifencodedisnullIllegalArgumentException- ifencodedis incorrectly formatted
-
-
Method Details
-
getName
Returns the attribute's ASN.1 Object Identifier represented as a list of dot-separated integers.- Specified by:
getNamein interfaceKeyStore.Entry.Attribute- Returns:
- the attribute's identifier
-
getValue
Returns the attribute's ASN.1 DER-encoded value as a string. An ASN.1 DER-encoded value is returned in one of the followingStringformats:- the DER encoding of a basic ASN.1 type that has a natural string representation is returned as the string itself. Such types are currently limited to BOOLEAN, INTEGER, OBJECT IDENTIFIER, UTCTime, GeneralizedTime and the following six ASN.1 string types: UTF8String, PrintableString, T61String, IA5String, BMPString and GeneralString.
- the DER encoding of any other ASN.1 type is not decoded but returned as a binary string of colon-separated pairs of hexadecimal digits.
Arrays.toString(java.lang.Object[]).- Specified by:
getValuein interfaceKeyStore.Entry.Attribute- Returns:
- the attribute value's string encoding
-
getEncoded
public byte[] getEncoded()Returns the attribute's ASN.1 DER encoding.- Returns:
- a clone of the attribute's DER encoding
-
equals
-
hashCode
-
toString
-