/** * Return the status object for the response - null indicates good. * * @return the status object for the response, null if it is good. */ public CertificateStatus getCertStatus() { CertStatus s = resp.getCertStatus(); if (s.getTagNo() == 0) { return null; // good } else if (s.getTagNo() == 1) { return new RevokedStatus(RevokedInfo.getInstance(s.getStatus())); } return new UnknownStatus(); }
/** * Return the status object for the response - null indicates good. * * @return the status object for the response, null if it is good. */ public Object getCertStatus() { CertStatus s = resp.getCertStatus(); if (s.getTagNo() == 0) { return null; // good } else if (s.getTagNo() == 1) { return new RevokedStatus(RevokedInfo.getInstance(s.getStatus())); } return new UnknownStatus(); }
private CertEtcToken(ASN1TaggedObject choice) { this.tagNo = choice.getTagNo(); switch (tagNo) { case TAG_CERTIFICATE: value = Certificate.getInstance(choice, false); break; case TAG_ESSCERTID: value = ESSCertID.getInstance(choice.getObject()); break; case TAG_PKISTATUS: value = PKIStatusInfo.getInstance(choice, false); break; case TAG_ASSERTION: value = ContentInfo.getInstance(choice.getObject()); break; case TAG_CRL: value = CertificateList.getInstance(choice, false); break; case TAG_OCSPCERTSTATUS: value = CertStatus.getInstance(choice.getObject()); break; case TAG_OCSPCERTID: value = CertID.getInstance(choice, false); break; case TAG_OCSPRESPONSE: value = OCSPResponse.getInstance(choice, false); break; case TAG_CAPABILITIES: value = SMIMECapabilities.getInstance(choice.getObject()); break; default: throw new IllegalArgumentException("Unknown tag: " + tagNo); } }
public ResponseObject( CertificateID certId, CertificateStatus certStatus, Date thisUpdate, Date nextUpdate, Extensions extensions) { this.certId = certId; if (certStatus == null) { this.certStatus = new CertStatus(); } else if (certStatus instanceof UnknownStatus) { this.certStatus = new CertStatus(2, DERNull.INSTANCE); } else { RevokedStatus rs = (RevokedStatus)certStatus; if (rs.hasRevocationReason()) { this.certStatus = new CertStatus( new RevokedInfo(new ASN1GeneralizedTime(rs.getRevocationTime()), CRLReason.lookup(rs.getRevocationReason()))); } else { this.certStatus = new CertStatus( new RevokedInfo(new ASN1GeneralizedTime(rs.getRevocationTime()), null)); } } this.thisUpdate = new DERGeneralizedTime(thisUpdate); if (nextUpdate != null) { this.nextUpdate = new DERGeneralizedTime(nextUpdate); } else { this.nextUpdate = null; } this.extensions = extensions; }
public ResponseObject( CertificateID certId, CertificateStatus certStatus, Date thisUpdate, Date nextUpdate, X509Extensions extensions) { this.certId = certId; if (certStatus == null) { this.certStatus = new CertStatus(); } else if (certStatus instanceof UnknownStatus) { this.certStatus = new CertStatus(2, DERNull.INSTANCE); } else { RevokedStatus rs = (RevokedStatus)certStatus; if (rs.hasRevocationReason()) { this.certStatus = new CertStatus( new RevokedInfo(new ASN1GeneralizedTime(rs.getRevocationTime()), CRLReason.lookup(rs.getRevocationReason()))); } else { this.certStatus = new CertStatus( new RevokedInfo(new ASN1GeneralizedTime(rs.getRevocationTime()), null)); } } this.thisUpdate = new DERGeneralizedTime(thisUpdate); if (nextUpdate != null) { this.nextUpdate = new DERGeneralizedTime(nextUpdate); } else { this.nextUpdate = null; } this.extensions = extensions; }