public class

SubjectKeyIdentifierExtension

extends Extension
implements CertAttrSet<T>
java.lang.Object
   ↳ sun.security.x509.Extension
     ↳ sun.security.x509.SubjectKeyIdentifierExtension

Class Overview

Represent the Subject Key Identifier Extension. This extension, if present, provides a means of identifying the particular public key used in an application. This extension by default is marked non-critical.

Extensions are addiitonal attributes which can be inserted in a X509 v3 certificate. For example a "Driving License Certificate" could have the driving license number as a extension.

Extensions are represented as a sequence of the extension identifier (Object Identifier), a boolean flag stating whether the extension is to be treated as being critical and the extension value itself (this is again a DER encoding of the extension value).

Summary

Constants
String IDENT Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
String KEY_ID
String NAME Attribute names.
[Expand]
Inherited Fields
From class sun.security.x509.Extension
Public Constructors
SubjectKeyIdentifierExtension(byte[] octetString)
Create a SubjectKeyIdentifierExtension with the passed octet string.
SubjectKeyIdentifierExtension(Boolean critical, Object value)
Create the extension from the passed DER encoded value.
Public Methods
void delete(String name)
Delete the attribute value.
void encode(OutputStream out)
Write the extension to the OutputStream.
Object get(String name)
Get the attribute value.
Enumeration<String> getElements()
Return an enumeration of names of attributes existing within this attribute.
String getName()
Return the name of this attribute.
void set(String name, Object obj)
Set the attribute value.
String toString()
Returns a printable representation.
[Expand]
Inherited Methods
From class sun.security.x509.Extension
From class java.lang.Object
From interface sun.security.x509.CertAttrSet

Constants

public static final String IDENT

Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.

Constant Value: "x509.info.extensions.SubjectKeyIdentifier"

public static final String KEY_ID

Constant Value: "key_id"

public static final String NAME

Attribute names.

Constant Value: "SubjectKeyIdentifier"

Public Constructors

public SubjectKeyIdentifierExtension (byte[] octetString)

Create a SubjectKeyIdentifierExtension with the passed octet string. The criticality is set to False.

Parameters
octetString the octet string identifying the key identifier.
Throws
IOException

public SubjectKeyIdentifierExtension (Boolean critical, Object value)

Create the extension from the passed DER encoded value.

Parameters
critical true if the extension is to be treated as critical.
value an array of DER encoded bytes of the actual value.
Throws
ClassCastException if value is not an array of bytes
IOException on error.

Public Methods

public void delete (String name)

Delete the attribute value.

Parameters
name the name of the attribute to delete.
Throws
IOException

public void encode (OutputStream out)

Write the extension to the OutputStream.

Parameters
out the OutputStream to write the extension to.
Throws
IOException on encoding errors.

public Object get (String name)

Get the attribute value.

Parameters
name the name of the attribute to return.
Throws
IOException

public Enumeration<String> getElements ()

Return an enumeration of names of attributes existing within this attribute.

Returns
  • an enumeration of the attribute names.

public String getName ()

Return the name of this attribute.

Returns
  • the name of this CertAttrSet.

public void set (String name, Object obj)

Set the attribute value.

Parameters
name the name of the attribute (e.g. "x509.info.key")
obj the attribute object.
Throws
IOException

public String toString ()

Returns a printable representation.

Returns
  • a string representation of the object.