public class OcspCertificateValidator extends Object
| Modifier and Type | Field and Description |
|---|---|
private javax.ws.rs.client.Client |
client |
private static int |
CONNECT_TIMEOUT |
private static String |
HTTPS |
private static org.slf4j.Logger |
logger |
private static String |
OCSP_REQUEST_CONTENT_TYPE |
private com.github.benmanes.caffeine.cache.LoadingCache<OcspRequest,OcspStatus> |
ocspCache |
private static int |
READ_TIMEOUT |
private Map<String,X509Certificate> |
trustedCAs |
private URI |
validationAuthorityURI |
| Constructor and Description |
|---|
OcspCertificateValidator(NiFiProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
private javax.ws.rs.core.Response |
getClientResponse(org.bouncycastle.cert.ocsp.OCSPReq ocspRequest) |
private X509Certificate |
getIssuerCertificate(X509Certificate[] certificates)
Gets the issuer certificate.
|
private X509Certificate |
getOcspCertificate(NiFiProperties properties)
Loads the ocsp certificate if specified.
|
private OcspStatus |
getOcspStatus(OcspRequest ocspStatusKey)
Gets the OCSP status for the specified subject and issuer certificates.
|
private X509Certificate |
getSubjectCertificate(X509Certificate[] certificates)
Gets the subject certificate.
|
private Map<String,X509Certificate> |
getTrustedCAs(NiFiProperties properties)
Loads the trusted certificate authorities according to the specified properties.
|
private X509Certificate |
getTrustedResponderCertificate(org.bouncycastle.cert.X509CertificateHolder responderCertificateHolder,
X509Certificate issuerCertificate)
Gets the trusted responder certificate.
|
void |
validate(X509Certificate[] certificates)
Validates the specified certificate using OCSP if configured.
|
private static final org.slf4j.Logger logger
private static final String HTTPS
private static final String OCSP_REQUEST_CONTENT_TYPE
private static final int CONNECT_TIMEOUT
private static final int READ_TIMEOUT
private URI validationAuthorityURI
private javax.ws.rs.client.Client client
private Map<String,X509Certificate> trustedCAs
private com.github.benmanes.caffeine.cache.LoadingCache<OcspRequest,OcspStatus> ocspCache
public OcspCertificateValidator(NiFiProperties properties)
private X509Certificate getOcspCertificate(NiFiProperties properties)
properties - nifi propertiesprivate Map<String,X509Certificate> getTrustedCAs(NiFiProperties properties)
properties - propertiespublic void validate(X509Certificate[] certificates) throws CertificateStatusException
certificates - the client certificatesCertificateStatusException - exprivate X509Certificate getSubjectCertificate(X509Certificate[] certificates)
certificates - certsprivate X509Certificate getIssuerCertificate(X509Certificate[] certificates)
certificates - certsprivate OcspStatus getOcspStatus(OcspRequest ocspStatusKey)
ocspStatusKey - status keyprivate javax.ws.rs.core.Response getClientResponse(org.bouncycastle.cert.ocsp.OCSPReq ocspRequest)
throws IOException
IOExceptionprivate X509Certificate getTrustedResponderCertificate(org.bouncycastle.cert.X509CertificateHolder responderCertificateHolder, X509Certificate issuerCertificate) throws CertificateException
responderCertificateHolder - certissuerCertificate - certCertificateExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.