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 Summary
Modifier and TypeMethodDescriptionbooleanisSigned()Indicates whether the request carries an optional signature.Optional<byte[]> nonce()Returns the request nonce, if present.Returns the requested certificate identifiers.Optional<byte[]> Returns the request signature, for a signed request.Returns the request signature algorithm identifier, for a signed request.Returns the signer certificates embedded in a signed request, if any.Optional<byte[]> Returns the exact DER of thetbsRequest(the signed portion).booleanverifySignature(PublicKey signerKey) Verifies the request signature against the given public key.
-
Method Details
-
requestedCertificates
-
nonce
-
isSigned
boolean isSigned()Indicates whether the request carries an optional signature.- Returns:
trueif 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 thetbsRequest(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
Verifies the request signature against the given public key.- Parameters:
signerKey- the public key to verify with- Returns:
trueif the request is signed and the signature is valid
-