Functions and Directives

Function IsCertificateAvailable() Professional

Checks whether a certificate is available on the computer.

IsCertificateAvailable( [<cSubject>] [, <cStoreName>] [, <cLocation>] ) --> lAvailable
A character string with the name of the entity associated with the certificate. The subject name is case-sensitive. It defaults to the computer name.
A character string specifying the name of the certificate store. If no store name is specified, "my" is used which corresponds to the default store.
A character string which selects the location of the certificate store. This can be either "user" or "machine". If no location is passed, the machine context is used as the default.

The logical value true (.T.), if the specified certificate is available on the computer. Otherwise, the value false (.F.) is returned.


The function IsCertificateAvailable() checks whether a certain server or client certificate is installed in the specified certificate store of the computer. The function can be used to check whether a certain server certificate is available to a HttpEndPoint() or a listening socket. See the function CertificateSelect() and the methods HttpEndPoint:setCertificate() for further information.

The certificate must be specified via the subject name, the name of the certificate store, and the location the store resides in. A certificate store can exist either in the user or in the machine context. The user context contains certificates for the current user, whereas certificates in the machine context are valid for the local machine.

When specifying the prefix "server:" in the <cSubject> parameter, the validation applies to server certificates only. To verify only the availability of a client certificate, use the "client:" prefix instead. Without a prefix in the <cSubject> parameter, the functions returns true (.T.) if at least one certificate type is available.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.