public class CertStatus
extends java.lang.Object
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);
RevokedInfo
,
UnknownInfo
,
SingleResponse
Modifier and Type | Field and Description |
---|---|
static int |
GOOD
CertStatus "good" (0).
|
static int |
REVOKED
CertStatus "revoked" (1).
|
static int |
UNKNOWN
CertStatus "unknown" (2).
|
Constructor and Description |
---|
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".
|
Modifier and Type | Method and Description |
---|---|
int |
getCertStatus()
Returns the cert status.
|
java.lang.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.
|
java.lang.String |
toString()
Returns a String representation of this CertStatus.
|
public static final int GOOD
public static final int REVOKED
public static final int UNKNOWN
public CertStatus()
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.
public CertStatus(RevokedInfo revokedInfo)
The "revoked" state indicates that the certificate has been revoked (either permanantly or temporarily (on hold)).
revokedInfo
- the revocation informationpublic CertStatus(UnknownInfo unknownInfo)
The "unknown" state indicates that the responder doesn't know about the certificate being requested.
unknownInfo
- an UnknownInfo, either representing a ASN.1 NULL object
or an ASN.1 ENUMERATEDpublic CertStatus(ASN1Object obj) throws CodingException
obj
- the CertStatus as ASN1ObjectCodingException
- if the ASN1Object has the wrong formatpublic int getCertStatus()
public java.lang.String getCertStatusName()
public RevokedInfo getRevokedInfo()
This method only may called when the indicated cert status is "revoked" (1).
public UnknownInfo getUnknownInfo()
This method only may called when the indicated cert status is "unknown" (2).
public ASN1Object toASN1Object()
public java.lang.String toString()
toString
in class java.lang.Object