SetCertificateProperty

Description: Sets a modifiable property on a stored certificate.
Returns: Integer. Zero for success or a system error code.
Usage: Script Only.
Function Groups: Certificates
Related to:

AddCertificate | CheckCertificateChain | FindCertificate | GetCertificateInfo | ListCertificates | MakeSelfSignedCertificate | RemoveCertificate

Format: SetCertificateProperty(MachineStore, StoreName, Thumbprint, Property, PropertyValue)
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 a certificate in a store in the Current User certificate hive.
StoreName
Required text. The name of the store in which to search for the certificate.
Thumbprint
Required. A binary buffer holding the SHA1 thumbprint of the certificate to locate.
Property
Required integer. The identifier of a property to set. Properties are identified by numbers.
PropertyValue
Required text. The text to which the property will be set.
Comments

This statement allows you to set the following properties:

Property Name Property Parameter
Friendly Name 0
Description 1

Once a certificate has been created, the only properties that can be set are those that do not comprise the signed part of the certificate.

Example:

SetCertificateProperty(FALSE, "My", NewCertThumbprint, 0, "North Point");

This sets the certificate identified by NewCertThumbprint in the current user’s Personal store to have the friendly name "North Point". The intent is to create an alternative human-friendly means of certificate identification.