Interface OcspRequest


public interface OcspRequest
A parsed OCSP request (RFC 6960).

Exposes the requested certificate identifiers and optional nonce, and — for signed requests — the exact to-be-signed bytes, signature, and any embedded signer certificates, so the request signature can be verified.

  • Method Details

    • requestedCertificates

      List<CertId> requestedCertificates()
      Returns the requested certificate identifiers.
      Returns:
      the requested cert ids (non-empty)
    • nonce

      Optional<byte[]> nonce()
      Returns the request nonce, if present.
      Returns:
      the nonce bytes, or empty
    • isSigned

      boolean isSigned()
      Indicates whether the request carries an optional signature.
      Returns:
      true if the request is signed
    • signatureAlgorithm

      Optional<AlgorithmIdentifier> signatureAlgorithm()
      Returns the request signature algorithm identifier, for a signed request.
      Returns:
      the signature algorithm, or empty
    • toBeSigned

      Optional<byte[]> toBeSigned()
      Returns the exact DER of the tbsRequest (the signed portion).
      Returns:
      the to-be-signed DER, or empty for an unsigned request
    • signature

      Optional<byte[]> signature()
      Returns the request signature, for a signed request.
      Returns:
      the signature bytes, or empty
    • signerCertificates

      List<X509Certificate> signerCertificates()
      Returns the signer certificates embedded in a signed request, if any.
      Returns:
      the signer certificates (possibly empty)
    • verifySignature

      boolean verifySignature(PublicKey signerKey)
      Verifies the request signature against the given public key.
      Parameters:
      signerKey - the public key to verify with
      Returns:
      true if the request is signed and the signature is valid