public class OCSPExtensions extends X509Extensions
X509Extensions
for handling
OCSP extensions.
This class can be used in the same way as the parent
X509Extensions
class for managing extensions
that may be included in OCSP requests or responses. An application wishing to
implement some private OCSP extension has to write a class by extending the
abstract class V3Extension
and statically
registering the implementation by its object id:
This class consists of two parts:
Every class which implements a specific extension must first register itself, e.g.:
MyPrivateExtension extends V3Extension { ... public static final ObjectID oid = ...; } OCSPExtensions.register(MyPrivateExtension.oid, MyPrivateExtension.class);Per default all OCSP ( RFC 2560), RFC 6960) extensions specified by RFC 2560 are implemented and registered by this class:
Additionally the Common PKI
CertHash
extension is registered.V3Extension
,
X509Extensions
critical_extensions, noncritical_extensions
Constructor and Description |
---|
OCSPExtensions()
Default Constructor.
|
OCSPExtensions(ASN1Object extensions)
Creates a new OCSPExtensions object from an ASN1Object.
|
OCSPExtensions(int initialCriticalExtensionsCapacity,
int initialNoncriticalExtensionCapacity)
Creates an OCSPExtensions object with the given initial capacities for the
and
hashtables. |
Modifier and Type | Method and Description |
---|---|
boolean |
addExtension(V3Extension e)
Adds an extension to this
OCSPExtensions object. |
V3Extension |
getExtension(ObjectID oid)
Returns a particular extension, specified by its object ID.
|
countExtensions, create, createExtensionsTable, decode, getCriticalExtensionOIDs, getExtensionValue, getNonCriticalExtensionOIDs, getRawExtensionValue, hasExtensions, hasUnsupportedCriticalExtension, listExtensions, parseExtensions, register, removeAllExtensions, removeExtension, toASN1Object, toString
public OCSPExtensions()
OCSPExtensions
object to be
supplied with V3Extensions.public OCSPExtensions(int initialCriticalExtensionsCapacity, int initialNoncriticalExtensionCapacity)
critical_extensions
and
noncritical_extensions
hashtables.initialCriticalExtensionsCapacity
- the initial capacity of the
critical_extensions
tableinitialNoncriticalExtensionCapacity
- the initial capacity of the
noncritical_extensions
tablepublic OCSPExtensions(ASN1Object extensions) throws X509ExtensionException
The given ASN1Object has the ASN.1 type "SEQUENCE of Extensions", and may
have been created by calling the toASN1Objetct
method.
extensions
- the extensions as ASN1ObjectX509ExtensionException
- if the extensions cannot be parsedpublic V3Extension getExtension(ObjectID oid) throws X509ExtensionInitException
This method creates a new implementation of the class registered for this
ObjectID and initializes it with its extension value. If the extension is
an unknown extension, an UnknownExtension
is returned. If the extension cannot be initialized
properly because of some error, an
X509ExtensionInitException
is
thrown.
getExtension
in class X509Extensions
oid
- the object ID of the extensionnull
if
notX509ExtensionInitException
- if the extension can not be initializedpublic boolean addExtension(V3Extension e) throws X509ExtensionException
OCSPExtensions
object.addExtension
in class X509Extensions
e
- the X509v3 extension to add to the list of extensionstrue
, if an extension with the same object id has been
replaced, or false
if there has yet not been included
any extension with the same ObjectIDX509ExtensionException
- if an error occurs while DER encoding the extension