Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.DSI.AbstractOcsp

Classes, interfaces and records

classeOcspError

inherits from Exception

(no public members)

classTstAbstractOcsp

inherits from TComponent

TstAbstractOcsp

Abstract base for the OCSP client components. It is fully functional except for FindIssuer, which a descendant must override to locate the issuer of the certificate under test in whatever certificate store the descendant manages.

constructor Create(AOwner: TComponent); override;
Create is the standard TComponent constructor: an application instantiates a concrete descendant (TsmOcsp or TstOcsp), in code or by dropping it on a form / data module, and Create seeds Timeout, MaxClockSkew, RequireSignatureCheck, Nonce, RequireNonce and NonceLength with their published defaults. Full description »
function CheckCertificate(const aCert: iCertificate): tOcspCertStatus; virtual;
CheckCertificate performs the complete OCSP transaction for aCert and returns its revocation status. Full description »
function ValidateStapledResponse(const aCert, aIssuer: iCertificate; const aStapleDER: OctetString): tOcspCertStatus; virtual;
ValidateStapledResponse checks a PRE-FETCHED OCSP response (e.g. one a TLS server stapled into its Certificate flight) for aCert against its issuer aIssuer. Full description »
property LastRawResponse: OctetString read FLastRawResponse;
LastRawResponse is the raw DER-encoded OCSPResponse from the most recent exchange (empty if none reached the responder). Use it as an OCSP staple. » member page
property LastNextUpdate: TDateTime read FLastNextUpdate;
LastNextUpdate is the nextUpdate (UTC) of the SingleResponse matched by the most recent CheckCertificate / ValidateStapledResponse, or 0 when the response carried no nextUpdate. A staple cache refreshes when it passes. » member page
property LastError: string read FLastError;
LastError holds a human readable description of the failure when the most recent CheckCertificate returned csError; it is empty otherwise. » member page
property LastResponseStatus: tOCSPResponseStatus read FLastResponseStatus;
LastResponseStatus is the OCSPResponseStatus of the most recent exchange. » member page
property LastRevocationTime: TDateTime read FLastRevocationTime;
LastRevocationTime / LastRevocationReason are valid after a csRevoked result and describe when and why the certificate was revoked. » member page
property LastRevocationReason: Integer read FLastRevocationReason;
LastRevocationReason is the CRLReason code (RFC 5280) taken from the revoked SingleResponse; read it after a CheckCertificate call reported the certificate as csRevoked. It is -1 when no reason was given or the certificate was not revoked. » member page
property LastRequestMethod: string read FLastRequestMethod;
LastRequestMethod is 'GET' or 'POST': the HTTP method the most recent exchange used. In RFC 5019 LightweightMode a small request is sent by GET. » member page
property LastNonce: OctetString read FLastNonce;
LastNonce is the RFC 8954 nonce placed in the most recent request, or empty when none was sent (always empty in RFC 5019 LightweightMode). » member page
property ResponderURL: string read FResponderURL write FResponderURL;
ResponderURL overrides the responder location from the certificate AIA extension. Leave empty to use the AIA URL. » member page
property Timeout: Cardinal read FTimeout write FTimeout default 15000;
Timeout is the per-read socket timeout in milliseconds (default 15000). » member page
property MaxClockSkew: Cardinal read FMaxClockSkew write FMaxClockSkew default 300;
MaxClockSkew is the tolerance, in seconds, applied to the thisUpdate / nextUpdate validity window (default 300). » member page
property RequireSignatureCheck: Boolean read FRequireSignatureCheck write FRequireSignatureCheck default True;
RequireSignatureCheck makes a failed or unauthorized response signature fatal (csError). When False the signature is still checked but a failure is tolerated; this is unsafe and only meant for diagnostics. Default True. » member page
property Nonce: Boolean read FNonce write FNonce default True;
Nonce adds an RFC 8954 nonce to each request. Default True. LightweightMode overrides it: no nonce is sent while LightweightMode is on (RFC 5019 sec.2.1.1). » member page
property RequireNonce: Boolean read FRequireNonce write FRequireNonce default False;
RequireNonce makes a missing response nonce fatal (csError). When False a response that omits the nonce is accepted (many responders serve pre-signed responses that cannot echo a nonce). A nonce that is present but does not match is always fatal. Default False. » member page
property NonceLength: Integer read FNonceLength write FNonceLength default 16;
NonceLength is the length, in octets, of the generated nonce (RFC 8954 permits 1..32; default 16). » member page
property LightweightMode: Boolean read FLightweightMode write FLightweightMode default False;
LightweightMode switches the client to the RFC 5019 "Lightweight OCSP Profile for High-Volume Environments": a request of 255 bytes or less is sent by HTTP GET (its DER is base64- then URL-encoded into the request path, RFC 5019 Sec 5) so intermediaries can cache the response; NO nonce is added r... Full description »

Types (enumerations, sets, aliases)

enumtOcspCertStatus

tOcspCertStatus Result of TstAbstractOcsp.CheckCertificate. The first three values map directly onto the OCSP CertStatus CHOICE (RFC 6960 4.2.1); csError is an out-of-band value that signals that no authoritative answer could be obtained (no responder URL, network failure, malformed or unauthorized response, signature failure, nonce mismatch, stale response, ...). Callers should treat csError according to their own soft-fail / hard-fail policy.

  tOcspCertStatus = (csGood,    // The certificate is not revoked.
                     csRevoked, // The certificate has been revoked.
                     csUnknown, // The responder does not know the certificate.
                     csError);  // The status could not be determined.

Routines