public final class Extension extends Object implements Extension
Extension ::= SEQUENCE {
extnID OBJECT IDENTIFIER,
critical BOOLEAN DEFAULT FALSE,
extnValue OCTET STRING
}
| Modifier and Type | Field and Description |
|---|---|
static ASN1Sequence |
ASN1
X.509 Extension encoder/decoder.
|
static boolean |
CRITICAL |
protected ExtensionValue |
extnValueObject |
static boolean |
NON_CRITICAL |
| Constructor and Description |
|---|
Extension(int[] extnID,
boolean critical,
byte[] extnValue) |
Extension(int[] extnID,
byte[] extnValue) |
Extension(String extnID,
boolean critical,
byte[] extnValue) |
Extension(String extnID,
boolean critical,
ExtensionValue extnValueObject) |
Extension(String extnID,
byte[] extnValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
dumpValue(StringBuilder sb,
String prefix) |
void |
encode(OutputStream out)
Writes the DER-encoded extension to
out. |
boolean |
equals(Object ext)
Compares this instance with the specified object and indicates if they
are equal.
|
BasicConstraints |
getBasicConstraintsValue() |
ExtensionValue |
getDecodedExtensionValue() |
byte[] |
getEncoded()
Returns ASN.1 encoded form of this X.509 Extension value.
|
String |
getId()
Returns the value of extnID field of the structure.
|
KeyUsage |
getKeyUsageValue() |
byte[] |
getRawExtnValue()
Returns the raw (undecoded octet string) value of extnValue
field of the structure.
|
byte[] |
getValue()
Returns the value of extnValue field of the structure.
|
int |
hashCode()
Returns an integer hash code for this object.
|
boolean |
isCritical()
Returns the value of critical field of the structure.
|
public static final boolean CRITICAL
public static final boolean NON_CRITICAL
protected ExtensionValue extnValueObject
public static final ASN1Sequence ASN1
public Extension(String extnID, boolean critical, ExtensionValue extnValueObject)
public Extension(String extnID, boolean critical, byte[] extnValue)
public Extension(int[] extnID,
boolean critical,
byte[] extnValue)
public Extension(String extnID, byte[] extnValue)
public Extension(int[] extnID,
byte[] extnValue)
public String getId()
public boolean isCritical()
isCritical in interface Extensionpublic byte[] getValue()
public byte[] getRawExtnValue()
public byte[] getEncoded()
public void encode(OutputStream out) throws IOException
Extensionout.encode in interface ExtensionIOException - when there is an encoding error or error writing to
outpublic boolean equals(Object ext)
Objecto must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true only if this ==
o. See Writing a correct
equals method
if you intend implementing your own equals method.
The general contract for the equals and Object.hashCode() methods is that if equals returns true for
any two objects, then hashCode() must return the same value for
these objects. This means that subclasses of Object usually
override either both methods or neither of them.
equals in class Objectext - the object to compare this instance with.true if the specified object is equal to this Object; false otherwise.Object.hashCode()public int hashCode()
ObjectObject.equals(java.lang.Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode method
if you intend implementing your own hashCode method.
hashCode in class ObjectObject.equals(java.lang.Object)public ExtensionValue getDecodedExtensionValue() throws IOException
IOExceptionpublic KeyUsage getKeyUsageValue()
public BasicConstraints getBasicConstraintsValue()
public void dumpValue(StringBuilder sb, String prefix)