Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTsmX509TrustedCertificates.FindCert

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.
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.
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.
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.
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.