SignOCSPRequest

Security and signatures

Description

Signs an unsigned DER-encoded OCSP request produced by an OCSP request builder, turning it into a signed request per RFC 6960 with the requestor named after the identity certificate and the identity certificates attached. The input must decode as exactly one complete unsigned request holding one single request.

With a software identity from OpenPKCS12, the request is signed with SHA-256; Ed25519 and Ed448 keys sign the request encoding itself without a digest. The identity certificate must be valid at the current time and, when it states a key usage, permit digital signatures; the certificate with its chain is limited to fewer than 1024 certificates and 64 KiB.

With a token identity from OpenPKCS11, the request is assembled and signed through the token: SHA-256 with RSA PKCS #1 or RSA-PSS padding when the certificate parameters permit SHA-256, MGF1 with SHA-256 and a 32-byte salt, ECDSA, or EdDSA. The assembled request must decode again as one signed request before it is returned.

Syntax

Delphi

function TPDFNativeSigningIdentity.SignOCSPRequest(const RequestDER: AnsiString; out SignedRequest: AnsiString; out ErrorText: WideString): Boolean;

Parameters

RequestDERComplete unsigned DER-encoded OCSP request; empty input or input above 64 KiB is rejected
SignedRequestReceives the DER-encoded signed request; cleared when the call fails
ErrorTextReceives an English diagnostic when the call fails

Return values

TrueSignedRequest holds the signed request of at most 64 KiB
FalseNo identity is open, the request is malformed or already signed, or an identity or signing check failed; ErrorText describes the failure

Remarks

The method rejects an enabled RSAPSSPadding flag; RSA-PSS for OCSP requests follows the parameters of the key itself.

The class is functional on non-Windows Free Pascal targets; on Windows targets the call reports native OCSP signing as unavailable.

See also

NativeOCSPSignedRequests, BuildOCSPRequest, FetchOCSPResponse, TPDFlibPKCS11Client