public class ErrorExtension extends V3Extension
An ErrorExtension
only may be created when calling a
listExtensions
method that is based on the
listExtensions()
method of the X509Extensions
class for obtaining
an enumeration listing all the extensions included in, for instance,
some particular certificate. The returned enumeration will contain an
ErrorExtension
for any extension which cannot be
initialized because of some error (the DER encoding of the extension value
is wrong, or the implementation is unable to parse the extension value).
An ErrorExtension
always will be marked as being critical. It
will contain the OID of the appertaining extension and can be queried for
a message trying to explain the reason for the error.
X509Extensions
critical
Constructor and Description |
---|
ErrorExtension(ObjectID objectID,
boolean critical,
java.lang.String errorMessage)
Creates a new broken extension.
|
Modifier and Type | Method and Description |
---|---|
ObjectID |
getObjectID()
Returns the ObjectID of the broken extension.
|
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object obj)
Implements the V3Extension Interface.
|
ASN1Object |
toASN1Object()
Only throws a X509ExtensionException, since an ErrorExtension only may be
used for displaying information about some broken extension.
|
java.lang.String |
toString()
Returns a string that represents the contents of this
ErrorExtension . |
getName, isCritical, setCritical
public ErrorExtension(ObjectID objectID, boolean critical, java.lang.String errorMessage)
objectID
- the ObjectID of the broken extensioncritical
- whether the broken extension is critical or noterrorMessage
- a message describing the reason of the errorpublic ASN1Object toASN1Object() throws X509ExtensionException
toASN1Object
in class V3Extension
X509ExtensionException
- since an ErrorExtension only may be
used for displaying information about some broken extensionpublic void init(ASN1Object obj)
init
in class V3Extension
obj
- the extension value as ASN1Objectpublic int hashCode()
hashCode
in class V3Extension
public ObjectID getObjectID()
getObjectID
in class V3Extension
public java.lang.String toString()
ErrorExtension
.toString
in class java.lang.Object