public final class Extension extends Object
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) |
boolean |
equals(Object ext)
Compares this instance with the specified object and indicates if they
are equal.
|
BasicConstraints |
getBasicConstraintsValue() |
boolean |
getCritical()
Returns the value of critical field of the structure.
|
ExtensionValue |
getDecodedExtensionValue() |
byte[] |
getEncoded()
Returns ASN.1 encoded form of this X.509 Extension value.
|
String |
getExtnID()
Returns the value of extnID field of the structure.
|
byte[] |
getExtnValue()
Returns the value of extnValue field of the structure.
|
KeyUsage |
getKeyUsageValue() |
byte[] |
getRawExtnValue()
Returns the raw (undecoded octet string) value of extnValue
field of the structure.
|
int |
hashCode()
Returns an integer hash code for this object.
|
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 getExtnID()
public boolean getCritical()
public byte[] getExtnValue()
public byte[] getRawExtnValue()
public byte[] getEncoded()
public boolean equals(Object ext)
Object
o
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 Object
ext
- the object to compare this instance with.true
if the specified object is equal to this Object
; false
otherwise.Object.hashCode()
public int hashCode()
Object
Object.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 Object
Object.equals(java.lang.Object)
public ExtensionValue getDecodedExtensionValue() throws IOException
IOException
public KeyUsage getKeyUsageValue()
public BasicConstraints getBasicConstraintsValue()
public void dumpValue(StringBuilder sb, String prefix)