public class OCSPVerifier extends RootStoreVerifier
Modifier and Type | Field and Description |
---|---|
protected static String |
id_kp_OCSPSigning |
protected static Logger |
LOGGER
The Logger instance
|
protected List<org.bouncycastle.cert.ocsp.BasicOCSPResp> |
ocsps
The list of OCSP responses.
|
rootStore
onlineCheckingAllowed, verifier
Constructor and Description |
---|
OCSPVerifier(CertificateVerifier verifier,
List<org.bouncycastle.cert.ocsp.BasicOCSPResp> ocsps)
Creates an OCSPVerifier instance.
|
Modifier and Type | Method and Description |
---|---|
org.bouncycastle.cert.ocsp.BasicOCSPResp |
getOcspResponse(X509Certificate signCert,
X509Certificate issuerCert)
Gets an OCSP response online and returns it if the status is GOOD
(without further checking).
|
boolean |
isSignatureValid(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp,
Certificate responderCert)
Checks if an OCSP response is genuine
|
void |
isValidResponse(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp,
X509Certificate issuerCert)
Verifies if an OCSP response is genuine
If it doesn't verify against the issuer certificate and response's certificates, it may verify
using a trusted anchor or cert.
|
boolean |
verify(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp,
X509Certificate signCert,
X509Certificate issuerCert,
Date signDate)
Verifies a certificate against a single OCSP response
|
List<VerificationOK> |
verify(X509Certificate signCert,
X509Certificate issuerCert,
Date signDate)
Verifies if a a valid OCSP response is found for the certificate.
|
boolean |
verifyResponse(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp,
X509Certificate issuerCert)
Deprecated.
|
setRootStore
setOnlineCheckingAllowed
protected static final Logger LOGGER
protected static final String id_kp_OCSPSigning
protected List<org.bouncycastle.cert.ocsp.BasicOCSPResp> ocsps
public OCSPVerifier(CertificateVerifier verifier, List<org.bouncycastle.cert.ocsp.BasicOCSPResp> ocsps)
verifier
- the next verifier in the chainocsps
- a list of OCSP responsespublic List<VerificationOK> verify(X509Certificate signCert, X509Certificate issuerCert, Date signDate) throws GeneralSecurityException, IOException
verify
in class RootStoreVerifier
signCert
- the certificate that needs to be checkedissuerCert
- its issuersignDate
- the date the certificate needs to be validVerificationOK
objects.
The list will be empty if the certificate couldn't be verified.GeneralSecurityException
IOException
RootStoreVerifier.verify(java.security.cert.X509Certificate, java.security.cert.X509Certificate, java.util.Date)
public boolean verify(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp, X509Certificate signCert, X509Certificate issuerCert, Date signDate) throws GeneralSecurityException, IOException
ocspResp
- the OCSP responsesignCert
- the certificate that needs to be checkedissuerCert
- the certificate of CAsignDate
- sign datetrue
, in case successful check, otherwise false.GeneralSecurityException
IOException
public void isValidResponse(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp, X509Certificate issuerCert) throws GeneralSecurityException, IOException
ocspResp
- the OCSP responseissuerCert
- the issuer certificateGeneralSecurityException
IOException
@Deprecated public boolean verifyResponse(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp, X509Certificate issuerCert)
isValidResponse()
instead.ocspResp
- the response objectissuerCert
- the issuer certificatepublic boolean isSignatureValid(org.bouncycastle.cert.ocsp.BasicOCSPResp ocspResp, Certificate responderCert)
ocspResp
- the OCSP responseresponderCert
- the responder certificatepublic org.bouncycastle.cert.ocsp.BasicOCSPResp getOcspResponse(X509Certificate signCert, X509Certificate issuerCert)
signCert
- the signing certificateissuerCert
- the issuer certificateCopyright © 2020. All rights reserved.