Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

eventTstCustomKeyFilterChain.OnInvalidCertificate

property OnInvalidCertificate: tSignatureVerificationFailureEvent read fOnInvalidCertificate write SetOnInvalidCertificate;
OnInvalidCertificate might be triggered by CheckCertificate at three stages:
* If the certificate has expired and CheckValidityDate is True. In such case OnInvalidCertificate will be invoked with aCACert set to nil, and aErrorCodes will include pcvExpired
* If the issuer certificate could not be found in TrustedKeys or among any previously verified and cached certificates. In such case OnInvalidCertificate will be invoked with aCACert either equal to aCert (if aCert is self signed) or nil. aErrorCodes will include pcvIssuerNotTrusted
* If verification against the issuer certificate aCACert fails for any other reason, such as an invalid signature or other inconsistencies. The signature is examined at this stage whenever it can be, also when other problems were found first, and aErrorCodes then includes pcvInvalidSignature if it does not verify. NOTE: aErrorCodes lists the problems found up to that stage, which need not be ALL the problems with the certificate - at the first two stages, for instance, no signature has been examined. That is why both aCert and aCACert are passed: they make further investigation possible before the handler decides. NOTE: Setting aExplicitTrust to True will make CheckCertificate ignore the error and continue execution, but aErrorMsg and aErrorCodes will NOT be reset. If aCert is both expired and issued by an unknown CA and OnInvalidCertificate sets aExplicitTrust to True, aErrorCodes will include pcvExpired the first time OnInvalidCertificate is triggered and both pcvExpired and pcvIssuerNotTrusted the second time. NOTE: Setting aExplicitTrust to True never admits a certificate whose signature does not hold against aCACert. When, at the third stage, the signature does not verify, or cannot be verified (the certificate did not load, an unsupported algorithm, the wrong issuer, an issuer key that cannot be used), CheckCertificate returns False whatever the handler decides. A certificate issued by an unknown CA, or a self signed one, can still be trusted explicitly at the second stage.

NOTE: TstKeyFilterChain.OnInvalidCertificate occurs before TstCertificateManager.OnInvalidCertificate.