iaik.x509.ocsp
Class UnknownInfo

java.lang.Object
  |
  +--iaik.x509.ocsp.UnknownInfo

public class UnknownInfo
extends Object

This class implements the OCSP type UnknownInfo.

If an OCSP server does not know about the status of the certificate for which information is requested, it responds with the status "Unknown" (see RFC 2560):

 CertStatus ::= CHOICE {
   good                [0]     IMPLICIT NULL,
   revoked             [1]     IMPLICIT RevokedInfo,
   unknown             [2]     IMPLICIT UnknownInfo }

 UnknownInfo ::= NULL -- this can be replaced with an enumeration
 
Since the NULL UnknownInfo can be replaced by an enumeration, this class provides the alternative of supplying an int value when creating an UnknownInfo. In this case the interpretation of the ENUMERATED UnknownInfo is left to the application.

However, to support this ENUMERATED choice, a work around is required by class CertStatus for parsing an UnknownInfo since the "unknown" component is implicitly tagged not allowing a choice for the UnknownInfo:

 CertStatus ::= CHOICE {
   good                [0]     IMPLICIT NULL,
   revoked             [1]     IMPLICIT RevokedInfo,
   unknown             [2]     IMPLICIT UnknownInfo }
 

For creating a cert status for an UnknownInfo simply call the corresponding constructor of class CertStatus:

 CertStatus certStatus = new CertStatus(new UnknownInfo());
 

Version:
File Revision 8
See Also:
CertStatus

Constructor Summary
UnknownInfo()
          Default constructor.
UnknownInfo(ASN1Object obj)
          Creates an UnknownInfo from an ASN1Object.
UnknownInfo(int value)
          Creates an UnknownInfo from the given value to be represented as ASN.1 ENUMERATED.
 
Method Summary
 Object getValue()
          Returns the value of this UnknownInfo.
 ASN1Object toASN1Object()
          Returns this UnknownInfo as an ASN1Object.
 String toString()
          Gives a String representation of this UnknownInfo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnknownInfo

public UnknownInfo()
Default constructor. Use this constructor if this UnknownInfo shall represent an ASN.1 NULL type.

UnknownInfo

public UnknownInfo(int value)
Creates an UnknownInfo from the given value to be represented as ASN.1 ENUMERATED. The interpretation of the value is left to the application. Use this constructor if this UnknownInfo shall represent an ASN.1 ENUMERATED type.
Parameters:
value - the value that shall be represented by this enumeration UnknownInfo

UnknownInfo

public UnknownInfo(ASN1Object obj)
            throws CodingException
Creates an UnknownInfo from an ASN1Object.
Parameters:
obj - the UnknownInfo as ASN1Object
Throws:
CodingException - if the ASN1Object has the wrong format
Method Detail

toASN1Object

public ASN1Object toASN1Object()
Returns this UnknownInfo as an ASN1Object.
Returns:
this UnknownInfo as ASN.1 NULL or ENUMERATED

getValue

public Object getValue()
Returns the value of this UnknownInfo.
Returns:
NULL if this UnknownInfo represents an ASN.1 NULL type, and an Integer if this UnknownInfo represents an ASN.1 ENUMERATED

toString

public String toString()
Gives a String representation of this UnknownInfo.
Overrides:
toString in class Object
Returns:
a string representation of this UnknownInfo

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