Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.DSI.PkixOcsp

Feature notes: PKIX / CMS implementation notes

Classes, interfaces and records

classTstOcsp — component reference

inherits from TstAbstractOcsp

TstOcsp

OCSP client backed by a TstCertificateManager. Assign the manager that resolves the issuing CA of the certificates under test to CertificateManager before calling CheckCertificate.

property CertificateManager: TstCustomCertificateManager read FCertificateManager write SetCertificateManager;
CertificateManager resolves the issuing CA of the certificate under test. It is mandatory. Assign it before CheckCertificate is first called: FindIssuer calls the manager's GetCACertificate, so an unassigned or wrongly scoped manager makes every lookup fail (typically surfacing as csError). Full description »

interfaceiOcspCacheItem

iOcspCacheItem / TstOcspCacheItem is the thread-safe per-certificate OCSP status slot the OCSP filter keeps for every certificate that passes THROUGH it, in a SECONDARY list. This is deliberately separate from the base filter's own key list, which by convention holds only the identifiers the filter FORBIDS - so the cache of "seen and their verdict" never pollutes the forbidden set. It caches the last verdict + when it was taken, and guards against two threads querying the same certificate at once.

function BeginCheck(aMaxAgeSecs: Cardinal; out aStatus: tOcspCertStatus): Boolean;
BeginCheck returns True iff the CALLER should perform a fresh OCSP query now. When it returns False, aStatus already carries the verdict to use (a still-fresh cached one, or - if another thread is mid-query - the last known verdict, or csError if none yet).
procedure EndCheck(aStatus: tOcspCertStatus); function Peek(out aStatus: tOcspCertStatus): Boolean;
Peek returns the cached verdict WITHOUT claiming a query (read-only path).

classTstOcspCacheItem

inherits from TInterfacedObject

implements iOcspCacheItem

constructor Create; destructor Destroy; override; function BeginCheck(aMaxAgeSecs: Cardinal; out aStatus: tOcspCertStatus): Boolean; procedure EndCheck(aStatus: tOcspCertStatus); function Peek(out aStatus: tOcspCertStatus): Boolean;

classTstCustomKeyFilterOCSP

inherits from TstAbstractKeyFilter

TstCustomKeyFilterOCSP - OCSP revocation as a key filter.

Add an instance to a TstCertificateManager's filter list and bind Ocsp to a TstOcsp (whose CertificateManager resolves issuers). Every certificate the manager filters is then OCSP-checked: csRevoked -> forbidden; csGood -> allowed; csUnknown/csError -> allowed under rpSoftFail, forbidden under rpHardFail; rpIgnore or an unassigned Ocsp -> the filter is inert.

To prefer OCSP with a CRL fallback, order this filter BEFORE a TstKeyFilterCRL in the manager (a forbidding filter vetoes; ordering gives precedence).

constructor Create(AOwner: TComponent); override;
Owned by the TstCertificateManager you add the filter to; apps normally let the manager (or streaming) construct it rather than calling Create directly. Initialises the secondary status cache and the rpSoftFail / 3600s defaults. » member page
destructor Destroy; override;
Internal teardown; frees the secondary status cache after the base key list. Apps do not call this directly - the owning manager frees the filter. » member page
function IsKeyAllowed(const aIdentifier: OctetString; const aKey : iUnknown): Boolean; override;
The key-carrying entry point the key-manager calls for every certificate it hands out: runs the live OCSP check and returns False only for a definite csRevoked (or for csUnknown/csError under rpHardFail). Full description »
function IsIdentifierAllowed(const aIdentifier: OctetString): Boolean; override;
Identifier-only variant (no certificate available, so no live query): only a previously cached definite csRevoked verdict blocks; otherwise defers to the base list. Internal filter-chain wiring; apps do not call it directly. » member page
property Ocsp: TstOcsp read FOcsp write SetOcsp;
Ocsp performs the actual RFC 6960 lookups. Its own CertificateManager must be able to resolve the issuer of the certificates under test. » member page
property RevocationPolicy: TRevocationPolicy read FRevocationPolicy write FRevocationPolicy default rpSoftFail;
Decides what an inconclusive (csUnknown/csError) OCSP result means, and can switch the filter off. rpSoftFail (default) allows the certificate when the responder is unreachable or non-committal; rpHardFail forbids it (strict revocation checking); rpIgnore makes the filter inert without removing it. Full description »
property RevocationCacheMaxAge: Cardinal read FCacheMaxAge write FCacheMaxAge default 3600;
RevocationCacheMaxAge (seconds) is how long a cached verdict is reused before a fresh query. Default 3600 (1 hour). » member page

classTstKeyFilterOCSP — component reference

inherits from TstCustomKeyFilterOCSP

Palette component (RegisterComponents, with an icon).

(no public members)

classtKeyFilterOCSP

inherits from TstCustomKeyFilterOCSP

No-icon counterpart used by the key-manager's dynamic filter-creation option lists (RegisterNoIcon + RegisterClasses); Description supplies the picker text. Mirrors the TstKeyFilterCRL / tKeyFilterCRL pair.

class function Description: string; override;
Returns the value of rsUseKeyFilterOCSPFor.