Extension

Represent a X509 Extension Attribute.

<p>Extensions are additional 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.

<p>Extensions are represented as a sequence of the extension identifier (Object Identifier), a bool 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). <pre> ASN.1 definition of Extension: Extension ::= SEQUENCE { ExtensionId OBJECT IDENTIFIER, critical BOOLEAN DEFAULT FALSE, extensionValue OCTET STRING } </pre> All subclasses need to implement a constructor of the form <pre> <subclass> (Boolean, Object) </pre> where the Object is typically an array of DER encoded bytes. <p> @author Amit Kapoor @author Hemma Prafullchandra

Constructors

this
this()

Default constructor. Used only by sub-classes.

this
this(DerValue derVal)

Constructs an extension from a DER encoded array of bytes.

this
this(ObjectIdentifier extensionId, bool critical, byte[] extensionValue)

Constructs an Extension from individual components of ObjectIdentifier, criticality and the DER encoded OctetString.

this
this(Extension ext)

Constructs an Extension from another extension. To be used for creating decoded subclasses.

Members

Functions

encode
void encode(OutputStream stream)
Undocumented in source. Be warned that the author may not have intended to support it.
encode
void encode(DerOutputStream stream)

Write the extension to the DerOutputStream.

getExtensionId
ObjectIdentifier getExtensionId()

Returns the ObjectIdentifier of the extension.

getExtensionValue
byte[] getExtensionValue()

Returns the extension value as an byte array for further processing. Note, this is the raw DER value of the extension, not the DER encoded octet string which is in the certificate. This method does not return a clone; it is the responsibility of the caller to clone the array if necessary.

getId
string getId()
Undocumented in source. Be warned that the author may not have intended to support it.
getValue
byte[] getValue()
Undocumented in source. Be warned that the author may not have intended to support it.
isCritical
bool isCritical()

Returns true if extension is critical.

opEquals
bool opEquals(Object other)

Compares this Extension for equality with the specified object. If the <code>other</code> object is an <code>instanceof</code> <code>Extension</code>, then its encoded form is retrieved and compared with the encoded form of this Extension.

toHash
size_t toHash()

Returns a hashcode value for this Extension.

toString
string toString()

Returns the Extension in user readable form.

Static functions

newExtension
Extension newExtension(ObjectIdentifier extensionId, bool critical, byte[] rawExtensionValue)

Constructs an Extension from individual components of ObjectIdentifier, criticality and the raw encoded extension value.

Variables

critical
bool critical;
Undocumented in source.
extensionId
ObjectIdentifier extensionId;
Undocumented in source.
extensionValue
byte[] extensionValue;
Undocumented in source.

Meta