1
package org.bouncycastle.cert.ocsp;
5
import org.bouncycastle.asn1.DERGeneralizedTime;
6
import org.bouncycastle.asn1.ocsp.RevokedInfo;
7
import org.bouncycastle.asn1.x509.CRLReason;
10
* wrapper for the RevokedInfo object
12
public class RevokedStatus
13
implements CertificateStatus
27
this.info = new RevokedInfo(new DERGeneralizedTime(revocationDate), new CRLReason(reason));
30
public Date getRevocationTime()
32
return OCSPUtils.extractDate(info.getRevocationTime());
35
public boolean hasRevocationReason()
37
return (info.getRevocationReason() != null);
41
* return the revocation reason. Note: this field is optional, test for it
42
* with hasRevocationReason() first.
43
* @return the revocation reason value.
44
* @exception IllegalStateException if a reason is asked for and none is avaliable
46
public int getRevocationReason()
48
if (info.getRevocationReason() == null)
50
throw new IllegalStateException("attempt to get a reason where none is available");
53
return info.getRevocationReason().getValue().intValue();