public class OCSPVerifier extends RootStoreVerifier
| Modifier and Type | Field and Description |
|---|---|
protected static String |
id_kp_OCSPSigning |
protected static org.slf4j.Logger |
LOGGER
The Logger instance
|
protected List<com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp> |
ocsps
The list of
IBasicOCSPResp OCSP response wrappers. |
rootStoreonlineCheckingAllowed, verifier| Constructor and Description |
|---|
OCSPVerifier(CertificateVerifier verifier,
List<com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp> ocsps)
Creates an OCSPVerifier instance.
|
| Modifier and Type | Method and Description |
|---|---|
com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp |
getOcspResponse(X509Certificate signCert,
X509Certificate issuerCert)
Gets an OCSP response online and returns it if the status is GOOD
(without further checking!).
|
boolean |
isSignatureValid(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp ocspResp,
Certificate responderCert)
Checks if an OCSP response is genuine
|
void |
isValidResponse(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp ocspResp,
X509Certificate issuerCert,
Date signDate)
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(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp 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 valid OCSP response is found for the certificate.
|
setRootStoresetOnlineCheckingAllowedprotected static final org.slf4j.Logger LOGGER
protected static final String id_kp_OCSPSigning
protected List<com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp> ocsps
IBasicOCSPResp OCSP response wrappers.public OCSPVerifier(CertificateVerifier verifier, List<com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp> ocsps)
verifier - the next verifier in the chainocsps - a list of IBasicOCSPResp OCSP response wrapperspublic List<VerificationOK> verify(X509Certificate signCert, X509Certificate issuerCert, Date signDate) throws GeneralSecurityException
verify in class RootStoreVerifiersignCert - 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 - thrown if the certificate has expired, isn't valid yet, or if an exception has been thrown in Certificate#verify.RootStoreVerifier.verify(java.security.cert.X509Certificate,
java.security.cert.X509Certificate, java.util.Date)public boolean verify(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp ocspResp,
X509Certificate signCert,
X509Certificate issuerCert,
Date signDate)
throws GeneralSecurityException
ocspResp - IBasicOCSPResp the OCSP response wrappersignCert - the certificate that needs to be checkedissuerCert - the certificate of CA (certificate that issued signCert). This certificate is considered trusted
and valid by this method.signDate - sign datetrue, in case successful check, otherwise false.GeneralSecurityException - if OCSP response verification cannot be done or failedpublic void isValidResponse(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp ocspResp,
X509Certificate issuerCert,
Date signDate)
throws GeneralSecurityException
ocspResp - IBasicOCSPResp the OCSP response wrapperissuerCert - the issuer certificate. This certificate is considered trusted and valid by this method.signDate - sign dateGeneralSecurityException - if OCSP response verification cannot be done or failedpublic boolean isSignatureValid(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp ocspResp,
Certificate responderCert)
ocspResp - IBasicOCSPResp the OCSP response wrapperresponderCert - the responder certificatepublic com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp getOcspResponse(X509Certificate signCert, X509Certificate issuerCert)
signCert - the signing certificateissuerCert - the issuer certificateIBasicOCSPResp an OCSP response wrapperCopyright © 1998–2024 Apryse Group NV. All rights reserved.