Package network.oxalis.pkix.ocsp
Class OcspClient
- java.lang.Object
-
- network.oxalis.pkix.ocsp.OcspClient
-
public class OcspClient extends Object
Implementation of OCSP client supporting verification of a single certificate.- Author:
- erlend
-
-
Field Summary
Fields Modifier and Type Field Description static Property<Boolean>EXCEPTION_ON_NO_PATHstatic Property<Boolean>EXCEPTION_ON_REVOKEDstatic Property<Boolean>EXCEPTION_ON_UNKNOWNstatic Property<OcspFetcher>FETCHERstatic Property<List<X509Certificate>>INTERMEDIATESstatic Property<Boolean>NONCEstatic Property<URI>OVERRIDE_URLprotected PropertiespropertiesProperties provided by the builder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Builder<OcspClient>builder()Builder to create an instance of the client.protected URIdetectOcspUri(X509Certificate certificate)protected network.oxalis.pkix.ocsp.OcspResponsefetch(network.oxalis.pkix.ocsp.OcspRequest ocspReq, URI uri)protected X509CertificatefindIntermediate(X509Certificate certificate)Method for finding issuer by provided issuers in properties given an issued certificate.CertificateResultverify(URI uri, CertificateIssuer issuer, BigInteger serialNumber)CertificateResultverify(X509Certificate certificate)CertificateResultverify(X509Certificate certificate, X509Certificate issuer)CertificateResultverify(CertificateIssuer issuer, X509Certificate certificate)
-
-
-
Field Detail
-
FETCHER
public static final Property<OcspFetcher> FETCHER
-
INTERMEDIATES
public static final Property<List<X509Certificate>> INTERMEDIATES
-
properties
protected final Properties properties
Properties provided by the builder.
-
-
Method Detail
-
builder
public static Builder<OcspClient> builder()
Builder to create an instance of the client.- Returns:
- Prepared client.
-
verify
public CertificateResult verify(X509Certificate certificate) throws OcspException
- Throws:
OcspException
-
verify
public CertificateResult verify(X509Certificate certificate, X509Certificate issuer) throws OcspException
- Throws:
OcspException
-
verify
public CertificateResult verify(CertificateIssuer issuer, X509Certificate certificate) throws OcspException
- Throws:
OcspException
-
verify
public CertificateResult verify(URI uri, CertificateIssuer issuer, BigInteger serialNumber) throws OcspException
- Throws:
OcspException
-
findIntermediate
protected X509Certificate findIntermediate(X509Certificate certificate) throws OcspException
Method for finding issuer by provided issuers in properties given an issued certificate.- Parameters:
certificate- Issued certificate.- Returns:
- Issuer of the issued certificate.
- Throws:
OcspException- Thrown when no issuer is found.
-
detectOcspUri
protected URI detectOcspUri(X509Certificate certificate) throws OcspException
- Throws:
OcspException
-
fetch
protected network.oxalis.pkix.ocsp.OcspResponse fetch(network.oxalis.pkix.ocsp.OcspRequest ocspReq, URI uri) throws OcspException- Throws:
OcspException
-
-