|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.ac.Extension
public class Extension
This is the class representing the Extension ASN.1 construct. It contains an OCTET_STRING of the extension value, but the derived classes may parse that value to represent a meaningful structure instead, but they don't need to worry about encoding the value as OCTET_STRING.
Field Summary | |
---|---|
protected boolean |
critical
|
protected java.lang.String |
extnID
|
protected static NULL |
Null
|
protected ASN1Object |
theObject
|
Constructor Summary | |
---|---|
protected |
Extension()
|
|
Extension(Extension e)
This constructor creates a copy of the given Extension. |
|
Extension(java.lang.String extnID,
boolean critical)
This constructor builds an Extension with no value set. |
|
Extension(java.lang.String extnID,
boolean critical,
OCTET_STRING extnValue)
This constructor builds an Extension given the OID of the extension, its criticality flag and the ASN1Object of the Extension Value. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
decode(ASN1Object ao)
This method decodes a given ASN1Object. |
void |
decodeValue(ASN1Object ao)
This method decodes the Extension Value. |
ASN1Object |
encodeValue()
This method encodes the extension value to the ASN1Object representing the encoding of the extension value and returns it. |
java.lang.String |
extensionValueToString(java.lang.String indent)
This method returns the String representation of the extension value. |
java.lang.String |
getExtensionOID()
Returns the OID of the extension in the dotted form. |
OCTET_STRING |
getExtensionValue()
Returns the OCTET STRING of the extnValue. |
boolean |
isCritical()
Returns true if the extension is critical. |
void |
setCritical(boolean critical)
Sets the flag if the extension is critical. |
void |
setExtensionOID(java.lang.String oid)
Sets the OID of the extension in the dotted form. |
void |
setExtensionValue(OCTET_STRING value)
Sets the string of octets containing the extension value. |
ASN1Object |
toASN1Object()
This method returns the ASN1Object of the Extension. |
java.lang.String |
toString()
|
java.lang.String |
toString(java.lang.String ident)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String extnID
protected boolean critical
protected ASN1Object theObject
protected static final NULL Null
Constructor Detail |
---|
protected Extension()
public Extension(Extension e)
e
- - the Extension to copypublic Extension(java.lang.String extnID, boolean critical)
extnID
- - the OID of the Extensioncritical
- - the criticality flag; if true, the extension will be
marked critical; otherwise non-criticalpublic Extension(java.lang.String extnID, boolean critical, OCTET_STRING extnValue) throws CodingException
extnID
- - the OID of the extensioncritical
- - the criticality flag; if true, the extension is criticalextnValue
- - the OCTET_STRING of the extension value; can be null;
CodingException
Method Detail |
---|
public java.lang.String getExtensionOID()
public void setExtensionOID(java.lang.String oid)
public boolean isCritical()
public void setCritical(boolean critical)
public final OCTET_STRING getExtensionValue() throws CodingException
The descendant classes should override encodeValue() method to return the correct ASN1Object representing the extension value.
CodingException
public final void setExtensionValue(OCTET_STRING value) throws CodingException
The subclasses should override decodeValue() method to fill the extension with meaning.
CodingException
public ASN1Object toASN1Object() throws CodingException
CodingException
public void decode(ASN1Object ao) throws CodingException
CodingException
public void decodeValue(ASN1Object ao) throws CodingException
Override this method so that your Extension decodes what you want to fill in its internal fields.
ao
- - the ASN1Object obtained by BER-decoding the bytes of the
extension value OCTET STRING
CodingException
public ASN1Object encodeValue() throws CodingException
Override this method so that your Extension returns what you want.
CodingException
public java.lang.String extensionValueToString(java.lang.String indent)
Override this method if you need more user-friendly output of your custom extension value.
indent
- - the indentation to use at the beginning of each line to
make the text human-friendlypublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String ident)
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |