aaron-kumar / pkix-ocsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OCSP Client

Build Status Codecov

Getting started

Include dependency in your pom.xml:

<dependency>
    <groupId>net.klakegg.pkix</groupId>
    <artifactId>pkix-ocsp</artifactId>
    <version>0.9.0</version>
</dependency>

Create your own validator:

// Create OCSP Client using builder.
OcspClient client = OcspClient.builder()
        .set(OcspClient.EXCEPTION_ON_UNKNOWN, false) // Remove to trigger exception on 'UNKNOWN'.
        .set(OcspClient.EXCEPTION_ON_REVOKED, false) // Remove to trigger exception on 'REVOKED'.
        .build();

// Verify certificate (issuer certificate required).
CertificateResult response = client.verify(certificate, issuer);

// Prints 'GOOD', 'REVOKED' or 'UNKNOWN'.
System.out.println(response.getStatus());

About

License:Mozilla Public License 2.0


Languages

Language:Java 100.0%