Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.Mobile.X509Comp

Feature notes: TLS implementation notes (RFC map) · PKIX / CMS implementation notes

Classes, interfaces and records

classTMPX501Name

inherits from TPersistent

constructor Create(AOwner: TPersistent); destructor Destroy; override; procedure Assign(Source: TPersistent); override; procedure Clear; property Data: iName read FData; property ReadOnly: Boolean read FReadOnly write SetReadOnly; property commonName: string read GetcommonName write SetcommonName; property surname: string read Getsurname write Setsurname; property countryName: string read GetcountryName write SetcountryName; property localityName: string read GetlocalityName write SetlocalityName; property stateOrProvinceName: string read GetstateOrProvinceName write SetstateOrProvinceName; property organizationName: string read GetorganizationName write SetorganizationName; property organizationalUnitName: string read GetorganizationalUnitName write SetorganizationalUnitName; property title: string read Gettitle write Settitle; property name: string read Getname write Setname; property givenName: string read GetgivenName write SetgivenName; property initials: string read Getinitials write Setinitials; property generationQualifier: string read GetgenerationQualifier write SetgenerationQualifier; property dnQualifier: string read GetdnQualifier write SetdnQualifier; property emailAddress: string read GetemailAddress write SetemailAddress;

classTMPX509Validity

inherits from TPersistent

procedure Assign(Source: TPersistent); override; property ReadOnly: Boolean read FReadOnly write SetReadOnly; property notAfter: TDateTime read GetnotAfter write SetnotAfter; property notBefore: TDateTime read GetnotBefore write SetnotBefore;

interfaceiCertRevocationStatus

iCertRevocationStatus is the thread-safe, per-certificate revocation-status slot carried by a TCertStatusContainer. It caches the last verdict, when it was recorded and the CRL-set generation (CRLSetGeneration) it was reached under, and provides an atomic "check in progress" guard so a re-entrant OCSP-over-HTTPS lookup does not recurse into itself and concurrent verifications of the same certificate coalesce.

function Certificate: iCertificate; function BeginCheck(aKind: TRevKind): Boolean;
BeginCheck atomically claims the "in progress" flag for aKind. Returns True if this caller acquired it (and must pair it with EndCheck); False if a check of that kind is already running - the caller should then not start an overlapping/recursive check: CheckRevocation takes the verdict CachedStatus hands out, and otherwise consults the lists itself.
procedure EndCheck(aKind: TRevKind; aStatus: TCertStatusCode);
EndCheck records aStatus as the current verdict, reached under the CRL-set generation current at this call, and clears the in-progress flag for aKind. A caller that consulted OCSP or the lists before this call records with iCertRevocationStatusAsOf.EndCheckAsOf instead, as CheckRevocation does, so that a list changed meanwhile is not taken as consulted.
function CachedStatus(aMaxAge: TDateTime; out aStatus: TCertStatusCode): Boolean;
CachedStatus returns True (and the cached verdict in aStatus) when a verdict exists that may be reused. Full description »
function LastStatus: TCertStatusCode;
LastStatus is the most recent verdict regardless of age (crcOK if none).

interfaceiCertRevocationStatusAsOf

iCertRevocationStatusAsOf is implemented by the same slot as iCertRevocationStatus, for a caller that tells which lists a verdict rests on: aGeneration is the CRLSetGeneration value it read BEFORE it consulted OCSP or any CRL.

procedure EndCheckAsOf(aKind: TRevKind; aStatus: TCertStatusCode; aGeneration: Int64);
EndCheckAsOf is EndCheck for a verdict reached under CRL-set generation aGeneration. A list added or removed while the check ran leaves the verdict stamped with the older generation, which CachedStatus does not reuse. Full description »

classTCertStatusContainer

TCertStatusContainer wraps one iCertificate together with its thread-safe revocation-status slot. It is stored in FCerts in place of the bare certificate; because it delegates the entire iCertificate interface to the wrapped certificate (the "implements" clause), every existing consumer that reads FCerts as iCertificate (GetCerts, IndexOfCert, ...) is unaffected. The revocation slot is reached only from InternalVerifyCertificate and HeldCertRevocation, via Supports(FCerts[i], iCertRevocationStatus). Lifetime is managed by the list's reference counting (TInterfacedObject).

constructor Create(const aCert: iCertificate); destructor Destroy; override; property Cert: iCertificate read FCert implements iCertificate;
The wrapped certificate implements iCertificate on this object's behalf.

classTCertificateItem

inherits from TCollectionItem

constructor Create(Collection: TCollection); override; destructor Destroy; override; property Cert: iCertificate read FCert write SetCert; property Serial: string read FSerial write SetSerial stored False; property Subject: TMPX501Name read FSubject write SetSubject stored False; property Issuer: TMPX501Name read FIssuer write SetIssuer stored False; property Validity: TMPX509Validity read FValidity write SetValidity stored False; property PublicKeyAlg: TPublicKeyAlg read GetPublicKeyAlg write SetPublicKeyAlg stored False; property KeyUsage: TKeyUsage read GetKeyUsage write SetKeyUsage stored False; property ExtKeyUsage: TStrings read FExtKeyUsage write SetExtKeyUsage stored False; property BasicCA: Boolean read FCA write SetCA stored False; property BasicPathLenConstraint: Integer read FPathLenConstraint write SetPathLenConstraint stored False; property SubjectKeyIdentifier: string read FSubjectKeyIdentifier write SetSubjectKeyIdentifier; property AuthorityKeyIdentifier: string read FAuthorityKeyIdentifier write SetAuthorityKeyIdentifier; property CertIndex: Integer read GetCertIndex write SetCertIndex default -1; property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0; property CertId: string read FCertId write SetCertId;

classTsmX509TrustedCertificates — component reference

(no public members)

classTCertificateCollection

inherits from TOwnedCollection

constructor Create(AOwner: TsmX509TrustedCertificates);
Design-time collection that surfaces the certificates held by a TsmX509TrustedCertificates store as editable TCertificateItem entries in the Object Inspector (it is the type behind the published CertList property). Full description »

classTsmCustomX509TrustedCertificates

inherits from TComponent

constructor Create(AOwner: TComponent); override;
Abstract base of the certificate/CRL trust store. Applications work with the concrete descendant TsmX509TrustedCertificates and typically only see this type as the declared type of the CertSource property (used to chain one store onto another so a child store hijacks a group of certificates from... Full description »
destructor Destroy; override;
Tears the store down: detaches from any CertSource parent (removing itself from that parent's hijacker list), frees the hijacker list, and runs GCSweep so released iCertificate/iCertificateList graphs are reclaimed. Called by the owner/component framework; an application does not call it directly. » member page
procedure GCSweep;
Forces a sweep of the garbage-collected interface manager that reclaims cyclic iCertificate/iCertificateList graphs. Called automatically at teardown; an application rarely calls it directly, only when it wants to reclaim released certificate objects immediately rather than lazily. » member page
function AddCertificate(const Cert: iCertificate; ExplicitTrust: Boolean; var Status: TCertStatusCode; AllowExpired: Boolean = False; AllowDuplicateKeyIdentifier: Boolean = False): Integer; virtual; abstract;
Adds a parsed certificate to the store. ExplicitTrust marks it as a trust anchor (a root/CA the app decides to trust directly) rather than a leaf to be chained; Status returns why an add was rejected. Use this to populate a trust store at runtime from a loaded certificate. Abstract here; the working implementation is in TsmX509TrustedCertificates. » member page
function AddCRL(const CRL: iCertificateList; var Status: TCertStatusCode): Integer; virtual; abstract;
Adds a CRL to the store so later revocation checks can consult it. Abstract here; implemented by TsmX509TrustedCertificates. Apps typically feed CRLs in via this or via OnFetchCRL during path validation. » member page
function FindCRLs(const CACert: iCertificate; var CRLs: IInterfaceList): Integer; virtual; abstract;
Returns all CRLs held for the given CA certificate. Used internally by revocation checking; an app may call it to inspect which CRLs cover a CA. Abstract here; implemented by TsmX509TrustedCertificates. » member page
function FindRevocation(const Cert: iCertificate; var RC: iRevokedCertificate): Boolean; virtual; abstract;
Locates the revoked-certificate entry for Cert across the stored CRLs, if any. Underpins IsRevoked; apps usually call the higher-level IsRevoked / VerifyCertificate rather than this. Abstract here; implemented by TsmX509TrustedCertificates. » member page
property CertificateCollectionCount: Integer read GetCertificateCollectionCount;
Number of TCertificateCollection design-time collections exposed by this store. The base returns 0; TsmX509TrustedCertificates surfaces its CertList here. Internal Object-Inspector/persistence wiring an app rarely touches. » member page
property CertificateCollections[Index: Integer]: TCertificateCollection read GetCertificateCollections write SetCertificateCollections;
Indexed access to the store's design-time TCertificateCollection(s), paired with CertificateCollectionCount. Internal wiring for the property editor; applications normally use Certs / CertList instead. » member page

classTsmX509TrustedCertificates — component reference

inherits from TsmCustomX509TrustedCertificates

constructor Create(AOwner: TComponent); override;
Standard component constructor. Apps normally drop a TsmX509TrustedCertificates on a form or let a TsmStreamSecII create its four internal stores (TrustedCertificates / MyCertificates / CACertificates / CollectedCertificates) rather than calling this directly; call it only when building a store in code. » member page
destructor Destroy; override;
Standard destructor; releases the cert/CRL lists, index dictionaries and lock. Apps rarely call this directly - the owning component frees the store. » member page
function AddCertificate(const Cert: iCertificate; ExplicitTrust: Boolean; var Status: TCertStatusCode; AllowExpired: Boolean = False; AllowDuplicateKeyIdentifier: Boolean = False): Integer; override;
Adds a single certificate to the store after verifying it against the anchors already held (and any linked TrustedCACertificates). Full description »
function AddCRL(const CRL: iCertificateList; var Status: TCertStatusCode): Integer; override;
Adds a CRL to the store, verifying its issuer is a trusted CA and rejecting a superseded or out-of-sequence (delta-without-base) CRL. Use this to preload revocation data an app fetched itself; the store then consults it during revocation checks. » member page
procedure Clear; override;
Empties the store of all certificates and CRLs and resets the indexes. Use to rebuild a store from scratch, e.g. before reloading a fresh trust list. » member page
function DeleteCertificate(index: Integer): Boolean;
Removes the certificate at the given list index. Use when pruning a specific entry whose position you already know (e.g. from IndexOfCert); returns False if the index is out of range. » member page
procedure ExportAllToCMS(var ContentInfo: iContentInfo; NoSyntaxCheck: Boolean = False);
Serializes EVERY certificate and CRL in the store into a signer-less CMS SignedData ContentInfo (a degenerate SignedData used only as a cert/CRL bag). Use to snapshot a whole trust list for transport or persistence; pair with ImportFromCMS to reload it. » member page
procedure ExportAllToCMSFile(AFileName: TFileName);
As ExportAllToCMS, writing the DER-encoded CMS blob straight to a file. » member page
procedure ExportAllToCMSStream(AStream: TStream);
As ExportAllToCMS, writing the DER-encoded CMS blob to a stream. » member page
procedure ExportChainToCMS(var ContentInfo: iContentInfo; EndIndex: Integer; Sort: Boolean; IncludeRoot: Boolean; NoSyntaxCheck: Boolean = False);
Serializes just the chain from the certificate at EndIndex up through its issuers (following FindCACert), plus the relevant CRLs, into a CMS SignedData. IncludeRoot decides whether the self-signed root is emitted. Use to hand a peer exactly the path needed to validate one leaf, rather than the whole store. » member page
procedure ExportChainToCMSFile(AFileName: TFileName; EndIndex: Integer; Sort: Boolean; IncludeRoot: Boolean);
As ExportChainToCMS, writing the DER-encoded chain to a file. » member page
procedure ExportChainToCMSStream(AStream: TStream; EndIndex: Integer; Sort: Boolean; IncludeRoot: Boolean);
As ExportChainToCMS, writing the DER-encoded chain to a stream. » member page
procedure ExportChainToTLS(var Certificate: PTLSHandshake; var Len: Integer; EndIndex: Integer); overload;
Builds the TLS Certificate handshake message for the chain ending at EndIndex (root included per IncludeRootInTLSChain). Internal TLS plumbing that supplies the local endpoint's certificate list during a handshake; apps configure which cert is sent via the store, not by calling this directly. » member page
function ExportChainToTLS(var Certificate: PTLSHandshake; var Len: Integer; var Cert: iCertificate; CertTypes: TCertificateTypes; Issuers: TX501Names): Boolean; overload;
Selects a local certificate matching the peer's CertificateRequest (accepted CertTypes and Issuers) and encodes its chain as a TLS Certificate message, returning the chosen leaf in Cert. Internal TLS client-auth / server-cert selection plumbing keyed off the negotiated parameters. » member page
function ExportClientChainToTLS(var Certificate: PTLSHandshake; var Len: Integer; var Cert: iCertificate; const Request: TInternalCertificateRequest; const Check: TTLSClientCertificateCheck): Boolean;
Selects an eligible signing client identity from actual stored certificates. Issuer paths are limited to 32 certificates. Full description »
function ExtractConstraintsFromChain(CACert: iCertificate; BC: iBasicConstraints; NC: iNameConstraints; PolicyMappings: TStrings; Policies: TStrings; var RequirePolicy, AllowMapping: Boolean): Boolean;
Walks up the CA chain from CACert accumulating the effective basic constraints, name constraints, certificate policies and policy mappings that apply to certs issued under it. Used by path-validation logic (VerifyCAChain) to enforce RFC 5280 constraints; apps rarely call it directly. » member page
function ExtractSubjectDHPublicKey(const Cert: iCertificate; var PublKey: iDLPublicKey): Boolean;
Returns the subject Diffie-Hellman public key, borrowing the domain parameters from the issuing CA cert when the leaf itself omits them (DSS/DH inherited params). Use when you must operate on a cert's DH key directly. » member page
function ExtractSubjectDSAPublicKey(const Cert: iCertificate; var PublKey: iDLPublicKey): Boolean;
Returns the subject DSA public key, borrowing the CA's domain parameters when the leaf inherits them. Use to obtain a cert's DSA key for verification. » member page
function ExtractSubjectECPublicKey(const Cert: iCertificate; var PublKey: iDLPublicKey): Boolean;
Returns the subject EC public key. Use to obtain a cert's ECDSA/ECDH key for verification or key agreement. » member page
function FindCACert(const Cert: iCertificate; var CACert: iCertificate; SelfSignedMode: TSelfSignedMode = ssmReturnFalseIfSame): Boolean;
Locates the certificate in this store (or the linked TrustedCACertificates) that allegedly issued Cert. SelfSignedMode controls whether a self-signed cert returns itself. Core building block for chain building / path validation. » member page
function FindCert(const KeyIdentifier: OctetString; var Cert: iCertificate): Boolean; overload;
Finds a stored cert by its subject-key-identifier. Use to resolve a cert referenced by keyid, e.g. matching a CMS SignerInfo or an authorityKeyIdentifier. » member page
function FindCert(const Serial: OctetString; const Issuer: iName; var Cert: iCertificate): Boolean; overload;
Finds a stored cert by (issuer name, serial number) - the classic X.509 issuer/ serial pair used by CMS SignerInfo and CRL entries. » member page
function FindCert(const Serial: OctetString; const Issuer: iCertificate; var Cert: iCertificate): Boolean; overload;
Finds a stored cert by serial, matching the issuer via the issuer's own certificate (rather than a bare name). Use when you already hold the CA cert. » member page
function FindCert(const SignatureAlgorithms: array of ObjectIdentifier; const PKAlgorithms: array of ObjectIdentifier; const KeyUsage: TKeyUsage; var StartIndex: Integer; var Cert: iCertificate): Boolean; overload;
Scans the store from StartIndex for the next valid, non-revoked cert whose signature/public-key algorithm and key usage match. StartIndex is updated so the call can be repeated to enumerate all matches. Use to pick a local cert by capability. » member page
function FindCert(const SignatureAlgorithms: array of ObjectIdentifier; const PKAlgorithms: array of ObjectIdentifier; const KeyUsage: TKeyUsage; const ExtKeyUsage: array of ObjectIdentifier; var StartIndex: Integer; var Cert: iCertificate; ReverseSearch: Boolean = False): Boolean; overload;
As the previous overload but also filtering on extended key usage (e.g. id_kp_serverAuth / id_kp_clientAuth). ReverseSearch scans downward from StartIndex. This is the workhorse behind selecting a TLS server or client certificate from MyCertificates by role. » member page
function FindCRL(const CACert: iCertificate; const issuingDistPoint: iIssuingDistPointSyntax; var CRL: iCertificateList): Boolean; overload;
Finds a held CRL issued by CACert whose issuing-distribution-point matches the supplied one (also searching the linked TrustedCACertificates). Use to locate the exact partitioned CRL that covers a given distribution point. » member page
function FindCRL(const CACert: iCertificate; const Reasons: tReasonFlags; var CRL: iCertificateList): Boolean; overload;
Finds a held CRL from CACert that covers the given revocation reasons, matched against the CA's CRLDistributionPoints. Use when checking revocation for a specific reason set. » member page
function FindCRLCACert(const CRL: iCertificateList; var CACert: iCertificate): Boolean;
Given a CRL, finds the stored CA certificate that signed it (also searching the linked TrustedCACertificates). Use to authenticate an incoming CRL. » member page
function FindCRLs(const CACert: iCertificate; var CRLs: IInterfaceList): Integer; override;
Returns ALL held CRLs issued by CACert, merged with those from the linked TrustedCACertificates. This delegation is what lets a delegating store (e.g. a TLS server's CollectedCertificates pointing at its RootCerts) see the CA's CRL during revocation checking. » member page
function FindRevocation(const Cert: iCertificate; var RC: iRevokedCertificate): Boolean; override;
Resolves whether Cert appears revoked, returning the matching revokedCertificate entry (including indirect-CRL issuer validation). Lower-level than IsRevoked; use when you need the revocation entry itself, not just a yes/no. » member page
function FindServerCert(const SignatureAlgorithms: array of ObjectIdentifier; const PKAlgorithms: array of ObjectIdentifier; const KeyUsage: TKeyUsage; const URI: string; const IPAddress: string; const DNSName: string; var StartIndex: Integer; var Cert: iCertificate): Boolean;
Finds the next valid, non-revoked server certificate (filters on the id_kp_serverAuth extended key usage via the FindCert overload) that also matches the requested identity - URI, IP address and/or DNS name checked against the cert's subjectAltName. Use to select a serverAuth cert for a requested host from a MyCertificates store. » member page
function ImportChainFromTLS(Certificate: PCertificate; Len: Integer; var EndCert: iCertificate; var Status: TCertStatusCodes): Boolean;
Parses a peer's TLS Certificate handshake message, adding each cert (sorted leaf -> root) to this store and returning the end-entity cert. BeforeImportTLSCert lets the app mark the leaf as explicitly trusted or allow expiry before import. This is how the received peer chain lands in CollectedCertificates during a handshake. » member page
function ImportFromCMS(var ContentInfo: iContentInfo; ExplicitTrust: Boolean; var Status: TCertStatusCodes; AllowExpired: Boolean = False; AllowDuplicateKeyIdentifier: Boolean = False): Boolean;
Loads every certificate (and CRL) from a CMS SignedData ContentInfo into the store, sorting so issuers are added before the certs they sign. Pass ExplicitTrust=True to trust the imported certs as anchors. Use to reload a trust list produced by ExportAllToCMS, or ingest a CA-supplied bundle. » member page
function ImportFromCMSFile(AFileName: TFileName; ExplicitTrust: Boolean; var Status: TCertStatusCodes; AllowExpired: Boolean = False; AllowDuplicateKeyIdentifier: Boolean = False): Boolean;
As ImportFromCMS, reading the CMS blob (DER or base64/PEM, auto-detected) from a file. Handy for loading a roots bundle at startup. » member page
function ImportFromCMSStream(AStream: TStream; ExplicitTrust: Boolean; var Status: TCertStatusCodes; AllowExpired: Boolean = False; AllowDuplicateKeyIdentifier: Boolean = False): Boolean;
As ImportFromCMS, reading the CMS blob (DER or base64/PEM, auto-detected) from a stream. » member page
function IndexOfCert(const Cert: iCertificate): Integer;
Returns the list index of a stored cert (by DER identity), or -1. Use to test membership or to obtain an index for DeleteCertificate / Certs. » member page
function IndexOfCRL(const CRL: iCertificateList): Integer;
Returns the list index of a stored CRL, or -1. » member page
function IsRevoked(const Cert: iCertificate): Boolean;
Convenience yes/no revocation test for Cert against the CRLs this store holds itself, not those of its TrustedCACertificates store: it finds the issuing CA and an entry counts only in a list of that CA, so an indirect CRL of another issuer does not. Use for a quick revocation gate; FindRevocation exposes the entry itself. » member page
function RemoveCertificate(const Cert: iCertificate): Boolean;
Removes every copy of Cert from the store. Use to revoke trust in a specific certificate at runtime. » member page
function VerifyCAChain(const Cert: iCertificate; var Code: TCertStatusCode; PolicyMappings: TStrings = nil; AcceptedPolicies: TStrings = nil; NC: iNameConstraints = nil; AllowExpired: Boolean = False): Boolean;
Validates the full CA chain above Cert against the store's anchors, enforcing basic/name/policy constraints and revocation: each CA certificate is looked up in the CRLs this store holds and, unless the store that decides a revocation check has rpIgnore, in those of the stores it delegates to (Tru... Full description »
function VerifyCertificate(const Cert: iCertificate; ExplicitTrust: Boolean; var Status: TCertStatusCode): Integer;
Verifies Cert against the store WITHOUT adding it (unlike AddCertificate), returning the same status codes. Use to test acceptability of a cert before deciding whether to store or trust it. » member page
property Count: Integer read GetCount;
Number of certificates currently held. Use to iterate Certs[0..Count-1]. » member page
property CRLCount: Integer read GetCRLCount;
Number of CRLs currently held. Use to iterate CRLs[0..CRLCount-1]. » member page
property Certs[index: Integer]: iCertificate read GetCerts write SetCerts;
Indexed access to the stored certificates. Reading enumerates the store; writing replaces the entry in place (only when the DER differs). » member page
property CRLs[index: Integer]: iCertificateList read GetCRLs write SetCRLs;
Indexed access to the stored CRLs. Reading enumerates them; writing replaces the entry in place. » member page
property AcceptedPolicies: TStrings read FAcceptedPolicies write SetAcceptedPolicies;
Certificate policy OIDs that a chain is allowed to assert during validation (an empty list means any-policy). Set to constrain which issuer policies you will honour. » member page
property CertList: TCertificateCollection read FCertList write SetCertList;
Design-time / persisted collection of certificates that populate this store. This is how certs dropped into the component at design time (or loaded from a CertSource) are held and streamed with the form. » member page
property CertSource;
Inherited external source that feeds CertList (e.g. a file/dir provider). Assign to load the store's certificates from an external location instead of embedding them. » member page
property GroupIndex default -1;
Selects which CertList group this store loads (matched against each TCertificateItem.GroupIndex); -1 means all. Use with the hijacker mechanism to partition one certificate collection across several stores. » member page
property LeastKeyBitSize: Integer read FLeastKeyBitSize write SetLeastKeyBitSize default 1024;
Minimum acceptable public-key size in bits for certs added/verified (default 1024). Raise to reject weak keys during validation. » member page
property RequiredPolicies: TStrings read FRequiredPolicies write SetRequiredPolicies;
Certificate policy OIDs a chain MUST assert to be accepted (empty = none required). Set to demand a specific issuance policy. » member page
property IncludeRootInTLSChain: Boolean read FIncludeRootInTLSChain write SetIncludeRootInTLSChain default True;
When True (default) the self-signed root is included in the chain sent over TLS by ExportChainToTLS. Set False to omit the root from the wire chain (common for well-known roots the peer already trusts). » member page
property TrustedCACertificates: TsmX509TrustedCertificates read FTrustedCACertificates write SetTrustedCACertificates;
An optional second store consulted for trust anchors and CRLs this store does not hold itself (FindCACert / FindCRLs / FindCRL delegate to it). Full description »
property BeforeImportTLSCert: TBeforeImportTLSCertEvent read FBeforeImportTLSCert write SetBeforeImportTLSCert;
Fired for the leaf just before a TLS peer chain is imported (ImportChainFromTLS), letting the app grant explicit trust or allow an expired leaf. Use to hook application-specific acceptance of incoming peer certificates. » member page
property OnCertNotTrusted: TCertNotTrustedEvent read FOnCertNotTrusted write SetOnCertNotTrusted;
Fired when a certificate fails the trust check during validation. Handle to log or override the "not trusted" outcome. » member page
property OnCertNotAccepted: TCertNotAcceptedEvent read FOnCertNotAccepted write SetOnCertNotAccepted;
Fired when AddCertificate rejects a cert, offering a Retry flag so the app can fix the condition (e.g. add the missing issuer) and have the add re-attempted. Also fired when ImportChainFromTLS refuses a peer leaf this store already holds for its revocation status or a CA above it; Retry then repeats those checks and the adding of the CA certificates the peer sent. » member page
property OnCertPolicy: TPolicyEvent read FOnCertPolicy write SetOnCertPolicy;
Fired during policy processing so the app can decide on a certificate policy the store does not already accept/require. Handle to implement custom policy rules. » member page
property RevocationPolicy: TRevocationPolicy read FRevocationPolicy write FRevocationPolicy default rpSoftFail;
RevocationPolicy selects whether/how revocation is checked and how an inconclusive result is treated (default rpSoftFail). Full description »
property CRLClockSkew: Cardinal read FCRLClockSkew write FCRLClockSkew default 300;
CRLClockSkew is the tolerance in SECONDS applied to a CRL's thisUpdate / nextUpdate window (default 300). » member page
property RevocationCacheMaxAge: Cardinal read FRevocationCacheMaxAge write FRevocationCacheMaxAge default 3600;
RevocationCacheMaxAge is how long, in SECONDS, a cached crcOK verdict is reused before re-checking (default 3600); an inconclusive verdict is reused as long under rpSoftFail and not at all under rpHardFail (see RevocationPolicy). Full description »
property OnCheckOcsp: TOcspCheckEvent read FOnCheckOcsp write FOnCheckOcsp;
OnCheckOcsp supplies an online (OCSP) revocation verdict; see TOcspCheckEvent. When unassigned the store uses CRLs only. » member page
property OnFetchCRL: TFetchCRLEvent read FOnFetchCRL write FOnFetchCRL;
OnFetchCRL is asked to download a fresh CRL when none is held; see TFetchCRLEvent. » member page
property OnFetchCAIssuer: TFetchCAIssuerEvent read FOnFetchCAIssuer write FOnFetchCAIssuer;
OnFetchCAIssuer enables the automatic AIA caIssuers chase in FindCACert; see TFetchCAIssuerEvent. Unassigned = no network fetch (default). » member page

Types (enumerations, sets, aliases)

typeiCertificate

  iCertificate = StreamSec.DSI.PkixCert.iCertificate;

typeiCertificate

  iCertificate = StreamSec.Mobile.PkixCert.iCertificate;

enumTCertStatusCode

  TCertStatusCode = (crcOK,crcExpired,crcInvalidSignature,crcCANotTrusted,
                     crcRevoked,crcCAExpiredOrRevoked,crcConstraintFault,
                     crcInvalidKeyUsage,crcUnsupportedExtension,crcSuperseeded,
                     crcSyntax,crcBaseNotFound,crcTrusted,crcTooSmallKey,
                     crcPolicyNotAccepted,crcDuplicateKeyIdentifier,
                     // NEW (revocation): these are appended so existing ordinals
                     // are unchanged.
                     crcRevocationUnknown, // Revocation status could not be
                                           //   established (no fresh CRL / no
                                           //   OCSP answer) under a hard-fail
                                           //   policy - see TRevocationPolicy.
                     crcCRLExpired);       // A CRL was found for the issuer but

setTCertStatusCodes

it is past its nextUpdate.

  TCertStatusCodes = set of TCertStatusCode;

procTTLSClientCertificateCheck

Local TLS client-identity selection. The callback receives the full locally available issuer path, including a root omitted from the transmitted chain. It must require a usable matching private key and an offered/permitted CertificateVerify scheme, and check the chain's offered signature schemes. Returning False skips this candidate and continues with the next identity.

  TTLSClientCertificateCheck = function(const Cert: iCertificate;
                                       const Chain: tRCArray): Boolean of object;

typeTRevocationPolicy

TRevocationPolicy has moved to StreamSec.DSI.Ocsp (a base unit reachable from both this component layer and the DSI filter layer); re-exported here as a type alias so existing StreamSec.Mobile.X509Comp clients keep compiling unchanged.

  TRevocationPolicy = StreamSec.DSI.Ocsp.TRevocationPolicy;

enumTRevKind

TRevKind selects which revocation mechanism a per-certificate status slot is tracking (used by iCertRevocationStatus.BeginCheck / EndCheck).

  TRevKind = (rkOcsp, rkCrl);

procTOcspCheckEvent

OnCheckOcsp asks for an ONLINE (OCSP) revocation verdict for aCert (issued by aCACert). The handler sets aStatus to crcOK / crcRevoked / crcRevocationUnknown and aHandled := True if it actually performed a check. If no handler is assigned, or it leaves aHandled False, the store falls back to CRL checking. A handler that leaves aHandled False, or raises, gives no answer, whatever it set aStatus to. TsmCustomTLSInternalServer wires this to its Ocsp component's CheckCertificate; the store resolves the handler up the TrustedCACertificates chain, so it works even when verification runs on a delegating store (e.g. CollectedCertificates).

  TOcspCheckEvent = procedure (Sender: TObject;
                               const aCert, aCACert: iCertificate;
                               var aStatus: TCertStatusCode;
                               var aHandled: Boolean) of object;

procTFetchCRLEvent

OnFetchCRL fires when no fresh, signature-valid CRL is held for aCACert. The handler may download one (aURL is the issuer's first cRLDistributionPoints URI when available) and add it to the store; set aHandled := True if a CRL was added, so the store re-evaluates. Wired to AbstractOcsp.FetchCRL + AddCRL.

  TFetchCRLEvent = procedure (Sender: TObject;
                              const aCACert: iCertificate;
                              const aURL: string;
                              var aHandled: Boolean) of object;

procTFetchCAIssuerEvent

OnFetchCAIssuer fires from FindCACert when aSubject's issuer is in neither this store nor the linked TrustedCACertificates store and aSubject carries an AIA caIssuers URL (aURL). The handler downloads and returns the issuer certificate in aIssuer (nil = fetch failed); it must NOT store anything - the store stages the fetched chain itself and only commits it once it anchors in a locally trusted certificate (see ChaseCAIssuers). Wired to AbstractOcsp.FetchCACerts by TsmCustomTLSInternalServer, under the same conditions as the automatic CRL fetch (OnFetchCRL).

  TFetchCAIssuerEvent = procedure (Sender: TObject;
                                   const aSubject: iCertificate;
                                   const aURL: string;
                                   var aIssuer: iCertificate) of object;

procTBeforeImportTLSCertEvent

  TBeforeImportTLSCertEvent = procedure (Sender: TObject;
                                         const Cert: iCertificate;
                                         var ExplicitTrust: Boolean;
                                         var AllowExpired: Boolean) of object;

procTCertNotTrustedEvent

  TCertNotTrustedEvent = procedure (Sender: TObject;
                                    const Cert: iCertificate;
                                    var ExplicitTrust: Boolean) of object;

procTCertNotAcceptedEvent

  TCertNotAcceptedEvent = procedure (Sender: TObject;
                                     const Cert: iCertificate;
                                     Status: TCertStatusCode;
                                     var aRetry: Boolean) of object;

procTPolicyEvent

  TPolicyEvent = procedure (Sender: TObject;
                            const Cert: iCertificate;
                            AcceptedPolicy: TStrings;
                            var Accept: Boolean) of object;

enumTPublicKeyAlg

  TPublicKeyAlg = (pkaRSA,pkaDSA,pkaECDSA,pkaDH,pkaECDH,pkaEdDSA,pkaMLDSA,pkaOther);

enumTSelfSignedMode

  TSelfSignedMode = (ssmReturnTrueIfSame,ssmReturnFalseIfSame);

arraytIntegerArray

  tIntegerArray = array of Integer;

Routines