|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--iaik.x509.V3Extension
|
+--iaik.x509.extensions.SubjectKeyIdentifier
This class implements the SubjectKeyIdentifier extension.
The SubjectKeyIdentifier extension is a non critical
standard X509v3 extension.
Each extension is associated with a specific certificateExtension
object identifier, derived from:
certificateExtension OBJECT IDENTIFIER ::=
{joint-iso-ccitt(2) ds(5) 29}
id-ce OBJECT IDENTIFIER ::= certificateExtension
The object identifier for the SubjectKeyIdentifier extension
is defined as:
id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 }
which corresponds to the OID string "2.5.29.14".
The X.509 Certificate and CRL profile presented in the PKIX internet draft draft-ietf-pkix-ipki-part1-07.txt specifies the subject key identifier extension for providing a means of identifying the particular public key used in an application. Where a reference to a public key identifier is needed (as with an Authority Key Identifier) and one is not included in the associated certificate, a SHA-1 hash of the subject public key shall be used. The hash shall be calculated over the value (excluding tag and length) of the subject public key field in the certificate.
ASN.1 definition:
SubjectKeyIdentifier ::= KeyIdentifier
KeyIdentifier ::= OCTET STRING
For adding a SubjectKeyIdentifier extension object to a X509Certificate, use
the a addExtension
method of the iaik.X509Certificate
class, e.g.:
SubjectKeyIdentifier subjectKeyIdentifier = new SubjectKeyIdentifier(new byte[] {1,2,3,4,5,6,7,8,9});
X505Certificate cert = new X509Certificate();
...
cert.addExtension(subjectKeyIdentifier);
OCTET_STRING,
AuthorityKeyIdentifier,
V3Extension,
X509Extensions,
X509Certificate| Field Summary | |
static ObjectID |
oid
The object identifier of this SubjectKeyIdentifier extension. |
| Fields inherited from class iaik.x509.V3Extension |
critical |
| Constructor Summary | |
SubjectKeyIdentifier()
Default constructor. |
|
SubjectKeyIdentifier(byte[] identifier)
Creates a SubjectKeyIdentifier extension with a defined identifier. |
|
| Method Summary | |
byte[] |
get()
Returns the identifier of this extension. |
ObjectID |
getObjectID()
Returns the object ID of this SubjectKeyIdentifier extension |
int |
hashCode()
Returns a hashcode for this identity. |
void |
init(ASN1Object obj)
Inits this SubjectKeyIdentifier implementation with an ASN1object
representing the value of this extension. |
void |
set(byte[] identifier)
Sets the identifier of this SubjectKeyIdentifier extension. |
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this SubjectKeyIdentifier
extension object. |
java.lang.String |
toString()
Returns a string that represents the contents of this SubjectKeyIdentifier extension. |
| Methods inherited from class iaik.x509.V3Extension |
getName,
isCritical,
setCritical |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final ObjectID oid
| Constructor Detail |
public SubjectKeyIdentifier()
SubjectKeyIdentifier object.
Use the set method for setting the key identifier
value, e.g.:
SubjectKeyIdentifier subjectKeyIdentifier = new SubjectKeyIdentifier();
subjectKeyIdentifier.set(new byte[] {1,2,3,4,5,6,7,8,9});
public SubjectKeyIdentifier(byte[] identifier)
SubjectKeyIdentifier extension with a defined identifier.
For instance:
SubjectKeyIdentifier subjectKeyIdentifier = new SubjectKeyIdentifier(new byte[] {1,2,3,4,5,6,7,8,9});
identifier - the subject key identifier as byte array| Method Detail |
public ObjectID getObjectID()
SubjectKeyIdentifier extensionpublic void init(ASN1Object obj)
SubjectKeyIdentifier implementation with an ASN1object
representing the value of this extension.
The given ASN1Object represents the key identifier value.
The given ASN1Object is the one created by toASN1Object().
This method is used by the X509Extensions class when parsing the ASN.1 representation
of a certificate for properly initializing an included
SubjectKeyIdentifier extension. This method initializes the
extension only with its value, but not with its critical
specification. For that reason, this method shall not be
explicitly called by an application.
obj - the SubjectKeyIdentifier as ASN1Objectpublic ASN1Object toASN1Object()
SubjectKeyIdentifier
extension object.
The returned ASN1Object is an ASN.1 OCTET_STRING representing the key identifier value:
SubjectKeyIdentifier ::= KeyIdentifier KeyIdentifier ::= OCTET STRING
SubjectKeyIdentifier as ASN1Objectpublic void set(byte[] identifier)
SubjectKeyIdentifier extension.
For instance:
SubjectKeyIdentifier subjectKeyIdentifier = new SubjectKeyIdentifier();
subjectKeyIdentifier.set(new byte[] {1,2,3,4,5,6,7,8,9});
identifier - a identifier as byte arraypublic byte[] get()
set(byte[])public int hashCode()
public java.lang.String toString()
SubjectKeyIdentifier extension.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||