iaik.x509.ocsp
Class UnknownResponseException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--iaik.x509.ocsp.OCSPException
                    |
                    +--iaik.x509.ocsp.UnknownResponseException
All Implemented Interfaces:
Serializable

public class UnknownResponseException
extends OCSPException

Exception that is thrown when an OCSP server sends an unknown (= unsupported) response.

The X.509 Online Certificate Status Protocol (RFC 2560) allows OCSP responses to be of various type. RFC 2560 itself only specifies one basic response type (BasicOCSPResponse) that has to be supported by any conforming implementation. Other response types may be identified by their object identifier to be included into the optional responseBytes field of an OCSPResponse message:

 OCSPResponse ::= SEQUENCE {
    responseStatus         OCSPResponseStatus,
    responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }

 ResponseBytes ::=       SEQUENCE {
     responseType   OBJECT IDENTIFIER,
     response       OCTET STRING }
 
When parsing the response sent by a server, class ResponseBytes 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, e.g. (reading in a DER encoded OCSPResponse from an input stream):
 try {
   // the input stream supplying a DER encoded OCSP response:
   InputStream is = ...;
   OCSPResponse ocspResponse = new OCSPResponse(is);
   ...
 } catch (UnknownResponseException ex) {
    System.out.println("This response is successful but contains an unknown response type:");
    UnknownResponseException unknown = (UnknownResponseException)ex;
    System.out.println("Unknown type: " + unknown.getResponseType());
    System.out.println("ASN.1 structure:");
    System.out.println(unknown.getUnknownResponse().toString());
 }
 

Version:
File Revision 8
See Also:
OCSPResponse, ResponseBytes, Response, BasicOCSPResponse, Serialized Form

Constructor Summary
UnknownResponseException(ObjectID responseType, ASN1 unknownResponse)
          Constructs an UnknownResponseException with no specified detail message.
UnknownResponseException(String msg, ObjectID responseType, ASN1 unknownResponse)
          Constructs an UnknownResponseException with the specified detail message.
 
Method Summary
 ObjectID getResponseType()
          Returns the reponse type of the unknown response.
 ASN1 getUnknownResponse()
          Returns an ASN.1 representation of the unknown response.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnknownResponseException

public UnknownResponseException(ObjectID responseType,
                                ASN1 unknownResponse)
Constructs an UnknownResponseException with no specified detail message.
Parameters:
responseType - the type oid of the unknown response
unknownResponse - the unknown response as ASN.1 object

UnknownResponseException

public UnknownResponseException(String msg,
                                ObjectID responseType,
                                ASN1 unknownResponse)
Constructs an UnknownResponseException with the specified detail message.
Parameters:
responseType - the type oid of the unknown response
unknownResponse - the unknown response as ASN.1 object
Method Detail

getResponseType

public ObjectID getResponseType()
Returns the reponse type of the unknown response.
Returns:
the response type of the unknown response

getUnknownResponse

public ASN1 getUnknownResponse()
Returns an ASN.1 representation of the unknown response.
Returns:
an ASN.1 representation of the unknown response to be queried for further information

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).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK