iaik.x509.ocsp
Class CertStatus

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

public class CertStatus
extends Object

This class implements the OCSP type CertStaus. The X.509 Online Certificate Status Protocol (RFC 2560) specifies the CertStatus type for being included into a SingleResponse to indicate the revocation status of a particular certificate asked for. The status either information either may be "good", "revoked" or "unknown":

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

good
The "good" state indicates a positive response to the status inquiry. At a minimum, this positive response indicates that the certificate is not revoked, but does not necessarily mean that the certificate was ever issued or that the time at which the response was produced is within the certificate's validity interval. Response extensions may be used to convey additional information on assertions made by the responder regarding the status of the certificate such as positive statement about issuance, validity, etc.
revoked
The "revoked" state indicates that the certificate has been revoked (either permanantly or temporarily (on hold)).
unknown
The "unknown" state indicates that the responder doesn't know about the certificate being requested.

A CertStatus object indicating the status "good" can be created by using the empty default constructor:

 CertStatus goodStatus = new CertStatus();
 
When creating a CertStatus for a "revoked" certificate, a RevokedInfo has to be supplied, e.g.:
 Date revocationDate = ...;
 RevokedInfo revokedInfo = new RevokedInfo(revocationDate);
 ReasonCode revocationReason = new ReasonCode(ReasonCode.keyCompromise);
 revokedInfo.setRevocationReason(revocationReason);
 CertStatus revokedStatus = new CertStatus(revokedInfo);
 
An UnknownInfo indicates the CertStatus "unknown":
 CertStatus unknownStatus = new CertStatus(new UnknownInfo());
 
After creating a CertStatus object it has to be included into a SingleResponse given for a particular certificate, e.g.:
 SingleResponse singleResponse = 
    new SingleResponse(reqCert, certStatus, thisUpdateDate);
 

Version:
File Revision 9
See Also:
RevokedInfo, UnknownInfo, SingleResponse

Field Summary
static int GOOD
          CertStatus "good" (0).
static int REVOKED
          CertStatus "revoked" (1).
static int UNKNOWN
          CertStatus "unknown" (2).
 
Constructor Summary
CertStatus()
          Creates a CertStatus for indicating the status information "good".
CertStatus(ASN1Object obj)
          Creates a CertStatus from an ASN1Object.
CertStatus(RevokedInfo revokedInfo)
          Creates a CertStatus for indicating the status information "revoked".
CertStatus(UnknownInfo unknownInfo)
          Creates a CertStatus for indicating the status information "unknown".
 
Method Summary
 int getCertStatus()
          Returns the cert status.
 String getCertStatusName()
          Returns the cert status as string.
 RevokedInfo getRevokedInfo()
          Returns the RevokedInfo, if present.
 UnknownInfo getUnknownInfo()
          Returns the UnknownInfo, if present.
 ASN1Object toASN1Object()
          Returns this CertStatus as an ASN1Object.
 String toString()
          Returns a String representation of this CertStatus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GOOD

public static final int GOOD
CertStatus "good" (0).

REVOKED

public static final int REVOKED
CertStatus "revoked" (1).

UNKNOWN

public static final int UNKNOWN
CertStatus "unknown" (2).
Constructor Detail

CertStatus

public CertStatus()
Creates a CertStatus for indicating the status information "good".

The "good" state indicates a positive response to the status inquiry. At a minimum, this positive response indicates that the certificate is not revoked, but does not necessarily mean that the certificate was ever issued or that the time at which the response was produced is within the certificate's validity interval. Response extensions may be used to convey additional information on assertions made by the responder regarding the status of the certificate such as positive statement about issuance, validity, etc.


CertStatus

public CertStatus(RevokedInfo revokedInfo)
Creates a CertStatus for indicating the status information "revoked".

The "revoked" state indicates that the certificate has been revoked (either permanantly or temporarily (on hold)).

Parameters:
revokedInfo - the revocation information

CertStatus

public CertStatus(UnknownInfo unknownInfo)
Creates a CertStatus for indicating the status information "unknown".

The "unknown" state indicates that the responder doesn't know about the certificate being requested.

Parameters:
unknownInfo - an UnknownInfo, either representing a ASN.1 NULL object or an ASN.1 ENUMERATED

CertStatus

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

getCertStatus

public int getCertStatus()
Returns the cert status.
Returns:
the cert status, "good" (0), "revoked" (1), or "unknown" (2)

getCertStatusName

public String getCertStatusName()
Returns the cert status as string.
Returns:
the cert status, "good", "revoked", or "unknown"

getRevokedInfo

public RevokedInfo getRevokedInfo()
Returns the RevokedInfo, if present.

This method only may called when the indicated cert status is "revoked" (1).

Returns:
the RevokedInfo, if cert status is "revoked" (1)

getUnknownInfo

public UnknownInfo getUnknownInfo()
Returns the UnknownInfo, if present.

This method only may called when the indicated cert status is "unknown" (2).

Returns:
the UnknownInfo, if cert status is "unknown" (2)

toASN1Object

public ASN1Object toASN1Object()
Returns this CertStatus as an ASN1Object.
Returns:
this CertStatus as ASN1Object

toString

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

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