public final class

OCSP

extends Object
java.lang.Object
   ↳ sun.security.provider.certpath.OCSP

Class Overview

This is a class that checks the revocation status of a certificate(s) using OCSP. It is not a PKIXCertPathChecker and therefore can be used outside of the CertPathValidator framework. It is useful when you want to just check the revocation status of a certificate, and you don't want to incur the overhead of validating all of the certificates in the associated certificate chain.

Summary

Nested Classes
interface OCSP.RevocationStatus The Revocation Status of a certificate. 
Public Methods
static OCSP.RevocationStatus check(X509Certificate cert, X509Certificate issuerCert, URI responderURI, X509Certificate responderCert, Date date)
Obtains the revocation status of a certificate using OCSP.
static OCSP.RevocationStatus check(X509Certificate cert, X509Certificate issuerCert)
Obtains the revocation status of a certificate using OCSP using the most common defaults.
static URI getResponderURI(X509Certificate cert)
Returns the URI of the OCSP Responder as specified in the certificate's Authority Information Access extension, or null if not specified.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static OCSP.RevocationStatus check (X509Certificate cert, X509Certificate issuerCert, URI responderURI, X509Certificate responderCert, Date date)

Obtains the revocation status of a certificate using OCSP.

Parameters
cert the certificate to be checked
issuerCert the issuer certificate
responderURI the URI of the OCSP responder
responderCert the OCSP responder's certificate
date the time the validity of the OCSP responder's certificate should be checked against. If null, the current time is used.
Returns
  • the RevocationStatus
Throws
IOException if there is an exception connecting to or communicating with the OCSP responder
CertPathValidatorException if an exception occurs while encoding the OCSP Request or validating the OCSP Response

public static OCSP.RevocationStatus check (X509Certificate cert, X509Certificate issuerCert)

Obtains the revocation status of a certificate using OCSP using the most common defaults. The OCSP responder URI is retrieved from the certificate's AIA extension. The OCSP responder certificate is assumed to be the issuer's certificate (or issued by the issuer CA).

Parameters
cert the certificate to be checked
issuerCert the issuer certificate
Returns
  • the RevocationStatus
Throws
IOException if there is an exception connecting to or communicating with the OCSP responder
CertPathValidatorException if an exception occurs while encoding the OCSP Request or validating the OCSP Response

public static URI getResponderURI (X509Certificate cert)

Returns the URI of the OCSP Responder as specified in the certificate's Authority Information Access extension, or null if not specified.

Parameters
cert the certificate
Returns
  • the URI of the OCSP Responder, or null if not specified