public class RevokedInfo
extends java.lang.Object
Within a CertStatus
the revoked
choice holds a RevokedInfo
giving information about
the revocation time and optionally specifying the revocation reason
(see RFC 2560,
RFC 6960):
RevokedInfo ::= SEQUENCE { revocationTime GeneralizedTime, revocationReason [0] EXPLICIT CRLReason OPTIONAL }When creating a RevokedInfo you have to supply the revocationTime as Java Date object. When using method
setRevocationReason
for including information about the
revocation reason, the reason has to be supplied as ReasonCode
object, e.g.:
Date revocationDate = ...; RevokedInfo revokedInfo = new RevokedInfo(revocationDate); ReasonCode revocationReason = new ReasonCode(ReasonCode.keyCompromise); revokedInfo.setRevocationReason(revocationReason);For creating a cert status for an RevokedInfo simply call the corresponding constructor of class
CertStatus
:
CertStatus certStatus = new CertStatus(revokedInfo);
CertStatus
Constructor and Description |
---|
RevokedInfo(ASN1Object obj)
Creates RevokedInfo from an ASN1Object.
|
RevokedInfo(ChoiceOfTime revocationTime)
Creates a RevokedInfo from a revocation date.
|
RevokedInfo(java.util.Date revocationTime)
Creates a RevokedInfo from a revocation date.
|
Modifier and Type | Method and Description |
---|---|
ReasonCode |
getRevocationReason()
Returns the revocation reason.
|
java.util.Date |
getRevocationTime()
Returns the revocationTime.
|
void |
setRevocationReason(ReasonCode reasonCode)
Sets the revocation reason field.
|
ASN1Object |
toASN1Object()
Returns this RevokedInfo as an ASN1Object.
|
java.lang.String |
toString()
Gives a string representation of this RevokedInfo.
|
public RevokedInfo(java.util.Date revocationTime)
revocationTime
- the time of revocationpublic RevokedInfo(ChoiceOfTime revocationTime)
revocationTime
- the time of revocation as ChoiceOfTime (GeneralizedTime)java.lang.IllegalArgumentException
- if the ChoiceOfTime is not of type ASN.1 GeneralizedTimepublic RevokedInfo(ASN1Object obj) throws CodingException
obj
- the RevokedInfo as ASN1ObjectCodingException
- if the ASN1Object has the wrong formatpublic void setRevocationReason(ReasonCode reasonCode)
ReasonCode
object, e.g.:
ReasonCode revocationReason = new ReasonCode(ReasonCode.keyCompromise); revokedInfo.setRevocationReason(revocationReason);
reasonCode
- the revocation reason as ReasonCode
objectpublic java.util.Date getRevocationTime()
public ReasonCode getRevocationReason()
ReasonCode
objectpublic ASN1Object toASN1Object()
public java.lang.String toString()
toString
in class java.lang.Object