SetSignProcessCertFromStoreByHandle
Security and signatures
Description
Selects the signing certificate for a sign process by a raw PCCERT_CONTEXT handle obtained externally - typically from EnumCertificates followed by CertDuplicateCertificateContext. This bypasses the by-Subject-CN lookup that SetSignProcessCertFromStore performs, letting callers pick a certificate by any criterion (qualified filter, validity window, fingerprint).
The handle must outlive the sign process (the caller owns it and must free it with CertFreeCertificateContext after EndSignProcess completes).
Syntax
Delphi
Function TPDFlib.SetSignProcessCertFromStoreByHandle(SignProcessID: Integer; CertHandle: Pointer): Integer;
Parameters
| SignProcessID | The sign process ID from NewSignProcessFromFile/Stream/String |
|---|---|
| CertHandle | A PCCERT_CONTEXT (as Pointer) obtained from EnumCertificates.CertHandle and duplicated via CertDuplicateCertificateContext |
Return values
| 0 | The sign process was not found or the handle was nil |
|---|---|
| 1 | The certificate handle was bound to the sign process |