Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTstCustomKeyFilterChain.CheckCertificate

function CheckCertificate(const aCert: iCertificate): Boolean; overload;
CheckCertificate is the main entry point an application calls to validate a certificate against this filter's configured trust anchors (TrustedKeys) and any cached, previously-verified CA certificates. It walks aCert up to a trusted issuer, verifies each signature, applies the validity-date check (subject to CheckValidityDate) and the name-constraint / policy checks, and returns True only if the whole chain is trusted. Used identically on both sides of a protocol: a TLS client validating the server certificate and a server validating a client certificate call the same method. This bare overload discards the diagnostic detail.
function CheckCertificate(const aCert : iCertificate; var aErrorCodes: tPkixCertVerificationErrors) : Boolean; overload;
Same validation as CheckCertificate(aCert), but returns the machine-readable failure reasons in aErrorCodes (e.g. pcvExpired, pcvIssuerNotTrusted, pcvConstraintFaultNameConstraints). Use this overload when the application needs to branch on WHY validation failed rather than just whether it did. aErrorCodes is REPLACED: it starts empty on entry and describes this call only, whatever the caller left in it. A verdict of True may still carry pcvExpired when an expired certificate was tolerated (CheckValidityDate False, or the aAllowExpired overload), so a caller that wants to know tests the set, not just the result. aErrorMsg, where an overload takes one, is APPENDED to and never cleared, so several certificates can be checked into one account of them.
function CheckCertificate(const aCert : iCertificate; var aErrorMsg: string) : Boolean; overload;
Same validation, returning a human-readable, possibly multi-line failure description in aErrorMsg - suitable for logging or display to an operator.
function CheckCertificate(const aCert : iCertificate; var aErrorCodes: tPkixCertVerificationErrors; var aErrorMsg : string) : Boolean; overload;
Same validation, returning BOTH the error-code set and the human-readable message. This is the overload the other overloads ultimately delegate to, and it honours the CheckValidityDate property to decide whether an expired certificate fails.
function CheckCertificate(const aCert : iCertificate; var aErrorCodes : tPkixCertVerificationErrors; var aErrorMsg : string; aAllowExpired: Boolean) : Boolean; overload;
Full-control overload: aAllowExpired forces the validity-date behaviour for this one call regardless of the CheckValidityDate property (pass True to accept an otherwise-valid but expired certificate, e.g. when re-validating an archived signature at its original signing time). All other trust, signature and constraint checks still apply.