|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.x509.ocsp.ResponseBytes
This class implements the OCSP type ResponseBytes
.
The X.509
Online Certificate Status Protocol (RFC 2560) specifies the
ResponseBytes
type for allowing to include specific
response information in an OCSPResponse
when the response status indicates a successful request processing:
OCSPResponse ::= SEQUENCE { responseStatus OCSPResponseStatus, responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } ResponseBytes ::= SEQUENCE { responseType OBJECT IDENTIFIER, response OCTET STRING }RFC 2560 itself only specifies one basic response type (
BasicOCSPResponse
) that has to be
supported by any conforming implementation. Other response types are allowed
and are identified by their object identifier to be included into the optional
responseBytes field of an OCSPResponse message.
This class includes a static part to be used for registering implementations for
particular response types. A response type may be implemented by extending the
abstract Response
class and registering it by
calling the static register
method of this
class, e.g.:
public class MyResponse extends Response { ... // the response type public static final ObjectID responseType = ...; ... } ... // register the implementation: ResponseBytes.register(MyResponse.responseType, MyResponse.class);When parsing the response sent by a server, this class tries to find an
implementation
for the response identified by
the responseType OID. If no implementation for the particular response type is
registered
, an UnknownResponseException
is thrown
allowing an application to query for the response type oid
and an ASN.1 epresentation
of the unknown response.
Currently only one response type, BasicOCSPResponse
is supported by this OCSP implementation.
Generaly an application will not have to use this class (except
for registering
its own response type
implementations). A response can be added immediately to an
OCSPResponse
object which internally
creates the required ResponseBytes.
Response
,
UnknownResponseException
,
BasicOCSPResponse
,
OCSPResponse
Constructor Summary | |
ResponseBytes(ASN1Object obj)
Creates ResponseBytes from its ASN.1 representation. |
|
ResponseBytes(Response response)
Creates ResponseBytes for the given response. |
Method Summary | |
static Response |
create(ObjectID responseType)
Returns the implementation of the specified response type defined by an ASN.1 ObjectID. |
void |
decode(ASN1Object obj)
Decodes ResponseBytes from its ASN.1 representation. |
Response |
getResponse()
Gets the response included in this ResponseBytes. |
ObjectID |
getResponseType()
Gets the type of the response of this ResponseBytes. |
static void |
register(ObjectID responseType,
Class cl)
Registers a class for implementing a particular response type. |
ASN1Object |
toASN1Object()
Returns this ResponseBytes as ASN1Object. |
String |
toString()
Returns a String representation of the ResponseBytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ResponseBytes(Response response)
response
- the responsepublic ResponseBytes(ASN1Object obj) throws CodingException, UnknownResponseException
UnknownResponseException
is thrown to be queried for information
about the unknown response.obj
- the ResponseBytes as ASN1ObjectCodingException
- if the ASN1Object cannot be parsedUnknownResponseException
- if this ResponseBytes contains
an response of unknown (= unsupported) typeMethod Detail |
public static Response create(ObjectID responseType) throws InstantiationException
This method belongs to the static part of this class.
oid
- the responseType OIDInstantiationException
- if the internal factory
couldn't create an instance of requested typepublic static void register(ObjectID responseType, Class cl)
This method belongs to the static part of this class.
responseType
- the type of the response to be registeredclass
- the class which implements this response typepublic Response getResponse()
public ObjectID getResponseType()
public void decode(ASN1Object obj) throws CodingException, UnknownResponseException
UnknownResponseException
is thrown to be queried for information about the unknown response.obj
- the ResponseBytes as ASN1ObjectCodingException
- if the ASN1Object cannot be parsedUnknownResponseException
- if this ResponseBytes contains
an response of unknown (= unsupported) typepublic ASN1Object toASN1Object()
public String toString()
toString
in class Object
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |