FindCertificate
(Engine-Level Function)
Description: | Locates a certificate in a certificate store. |
Returns: | Structure |
Usage: | Script Only. |
Function Groups: | Certificates |
Related to: | AddCertificate | CheckCertificateChain | GetCertificateInfo | ListCertificates | MakeSelfSignedCertificate | RemoveCertificate | SetCertificateProperty |
Format: | FindCertificate(MachineStore, StoreName, Thumbprint) |
Parameters: |
MachineStore |
Required Boolean. If TRUE (non-zero), attempts to find the certificate in a store in the Local Computer certificate hive. If FALSE (zero) attempts to find the certificate in a store in the Current User certificate hive. |
StoreName |
Required text. The name of the store in which to find the certificate. |
Thumbprint |
Required. A binary buffer holding the SHA1 thumbprint of the certificate to find. |
Comments |
This is a useful way of locating a certificate that corresponds to a thumbprint obtained earlier and obtaining a certificate structure for it. Thumbprints are convenient, compact values that can be persisted and used again later. Refer to ListCertificates for a description of the returned structure. |
Example:
CertificateInfo = FindCertificate(FALSE, "My", SavedThumbprint);
This will attempt to locate a certificate corresponding to SavedThumbprint in the current user’s Personal certificate store.