com.iplanet.trustbase.initiator.dsms
Class CertStatus

java.lang.Object
  |
  +--com.iplanet.trustbase.initiator.dsms.CertStatus

public class CertStatus
extends java.lang.Object

CertStatus represents the results of a Certificate Status Check It is returned as part of the array of StatusCheckData's that are returned when a check is performed. It utilises an inner class to store the actual certificate statuses - these can then be compared with the static instances which are public member variables in the class. The application programmer is referred to the Codes class for details about the possible response codes that can be returned when an error occurs.

See Also:
CSCEngine, StatusCheckData, com.iplanet.trustbase.initiator.dsms.Codes

Inner Class Summary
static class CertStatus.CS
           
 
Field Summary
static CertStatus.CS ERROR
          There was a responder error - check the response code Contains the code csc-error
static CertStatus.CS GOOD
          The certificate was valid at the time of the check Contains the code csc-good
static CertStatus.CS REVOKED
          The certificate was revoked at the time of the check Contains the code csc-revoked
static CertStatus.CS UNKNOWN
          The responder did not recognise the certificate Contains the code csc-unknown
static CertStatus.CS UNRECOGNIZED
          The responder has used an unrecognized cert status code possibly a more recent version of the protocol.
 
Constructor Summary
CertStatus(CertStatus.CS status, java.util.Date producedAt, java.security.cert.X509Certificate[] signingPath, com.iplanet.trustbase.security.ocsp.CertID checkCert, byte[] nonce, boolean isFreshnessProof)
          Construct a certificate status object which reflects a non-error status.
CertStatus(CertStatus.CS status, java.lang.String responseCode)
          Construct a certificate status object which reflects an error condition without further information.
CertStatus(CertStatus.CS status, java.lang.String responseCode, java.lang.Object[] responseArgs)
          Constructs a certificate status object which reflects an error status with response code and customised information.
CertStatus(CertStatus.CS status, java.lang.String responseCode, java.lang.Object[] responseArgs, java.lang.Throwable t)
          Constructs a Certificate status object which reflects an error status.
CertStatus(CertStatus.CS status, java.lang.String responseCode, java.lang.Throwable t)
          Constructs a Certificate status object which reflects an error status.
 
Method Summary
 CertStatus.CS getCertStatus()
          Get the cert status
 java.lang.String getCheckCertificateIssuerNameHash()
          Returns a hex encoded string of the issuer name hash of the checked certificate.
 java.lang.String getCheckCertificatePublicKeyHash()
          Returns a hex encoded string of the public key hash for the checked certificaye.
 java.math.BigInteger getCheckCertificateSerialNumber()
          Rerturn the serial number of the checked certificate.
 byte[] getNonce()
          Return the nonce used in the reponse - or null if there wasn't one.
 java.util.Date getProducedAt()
           
 java.lang.Object getResponseArgs()
          Get the arguments to the response code
 java.lang.String getResponseCode()
          Get the response code.
 java.security.cert.X509Certificate[] getSigningPath()
          Retrieves the signing certificate chain.
 boolean isCheckedCertificate(java.security.cert.X509Certificate issuerCertificate, java.security.cert.X509Certificate certificate)
          Check to see if this cert status represents that status of the given certificate.
 boolean isFreshnessProof()
          Is this a freshness proof.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GOOD

public static final CertStatus.CS GOOD
The certificate was valid at the time of the check Contains the code csc-good

REVOKED

public static final CertStatus.CS REVOKED
The certificate was revoked at the time of the check Contains the code csc-revoked

UNKNOWN

public static final CertStatus.CS UNKNOWN
The responder did not recognise the certificate Contains the code csc-unknown

ERROR

public static final CertStatus.CS ERROR
There was a responder error - check the response code Contains the code csc-error

UNRECOGNIZED

public static final CertStatus.CS UNRECOGNIZED
The responder has used an unrecognized cert status code possibly a more recent version of the protocol.
Constructor Detail

CertStatus

public CertStatus(CertStatus.CS status,
                  java.util.Date producedAt,
                  java.security.cert.X509Certificate[] signingPath,
                  com.iplanet.trustbase.security.ocsp.CertID checkCert,
                  byte[] nonce,
                  boolean isFreshnessProof)
Construct a certificate status object which reflects a non-error status.

CertStatus

public CertStatus(CertStatus.CS status,
                  java.lang.String responseCode)
Construct a certificate status object which reflects an error condition without further information.

CertStatus

public CertStatus(CertStatus.CS status,
                  java.lang.String responseCode,
                  java.lang.Object[] responseArgs)
Constructs a certificate status object which reflects an error status with response code and customised information. The client application must be carefull to correctly type the response args.

CertStatus

public CertStatus(CertStatus.CS status,
                  java.lang.String responseCode,
                  java.lang.Throwable t)
Constructs a Certificate status object which reflects an error status. A response code is given and a throwable.

CertStatus

public CertStatus(CertStatus.CS status,
                  java.lang.String responseCode,
                  java.lang.Object[] responseArgs,
                  java.lang.Throwable t)
Constructs a Certificate status object which reflects an error status. All possible information is handed to the client application.
Method Detail

isCheckedCertificate

public boolean isCheckedCertificate(java.security.cert.X509Certificate issuerCertificate,
                                    java.security.cert.X509Certificate certificate)
Check to see if this cert status represents that status of the given certificate.
Parameters:
issuerCertificate - the issuer of the certificate that you think this is a status for.
certificate - The certificate you would like know whether this cert status reflects the status for.
Returns:
boolean indicating whether this is the status for the certificate or not.

getCheckCertificateIssuerNameHash

public java.lang.String getCheckCertificateIssuerNameHash()
Returns a hex encoded string of the issuer name hash of the checked certificate. This method is supplied only for logging purposes.
Returns:
hex encoded representation of the issuer name hash of the certificate that this object represents.

getCheckCertificatePublicKeyHash

public java.lang.String getCheckCertificatePublicKeyHash()
Returns a hex encoded string of the public key hash for the checked certificaye. This method is provided for logging purposes only.
Returns:
hex encoded representation of the public key hash.

getCheckCertificateSerialNumber

public java.math.BigInteger getCheckCertificateSerialNumber()
Rerturn the serial number of the checked certificate. This method is provided for logging purposes only.
Returns:
The big integer representation of the checked certificate's serial number.

getCertStatus

public CertStatus.CS getCertStatus()
Get the cert status
Returns:
one of CertStatus.GOOD, CertStatus.REVOKED, CertStatus.UNKNOWN , CertStatus.ERROR or CertStatus.UNRECOGNIZED

getResponseCode

public java.lang.String getResponseCode()
Get the response code. This should be set if the CertStatus is ERROR, otherwise it is null.
Returns:
the response code, or null if the request was successful.

getResponseArgs

public java.lang.Object getResponseArgs()
Get the arguments to the response code
Returns:
the arguments, or null if there are none

getSigningPath

public java.security.cert.X509Certificate[] getSigningPath()
Retrieves the signing certificate chain.
Returns:
the certificate path used to sign the response

getProducedAt

public java.util.Date getProducedAt()
Returns:
the date at which the response was produced

isFreshnessProof

public boolean isFreshnessProof()
Is this a freshness proof. The concept of a freshness proof only applies during identrus operation. A freshness proof is enclosed with another response to prove the identity of the signing party.
Returns:
true if this CertStatus object is a freshness proof

getNonce

public byte[] getNonce()
Return the nonce used in the reponse - or null if there wasn't one.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a String representation of the status