ExportPFX

(Engine-Level Function)

Description: The ExportPFX function exports an X.509 certificate from a Windows certificate store and its private key into a password-protected PKCS12 (Public-Key Cryptography Standards #12) format file (.PFX)
Returns: Binary BLOB
Usage: Script Only.
Function Groups: Cryptography
Related to:  
Format: ExportPFX(UseMachineStore, Thumbprint, PFXPassword [, Error])
Parameters:  
UseMachineStore
Required. Boolean value. If TRUE uses the Windows certificate store dedicated to the local machine. If FALSE, uses the current Windows user's certificate store.
Thumbprint
Required. Binary buffer. The SHA-1 thumbprint of the certificate to export. This is used to uniquely identify the certificate in the certificate store. The \System.HexToBuff function can be used to convert a human-readable text string of hex digits into a binary buffer.
PFXPassword
Required. Text. The password used as the encryption seed to protect the output file. You will need to use this password to decrypt the file if you want to install the certificate from the file.
Error
Optional. A variable in which an error code will be returned. It has the following meaning:
Invalid - success.
Valid - A Windows error code indicating the failure cause.
Comments:

The certificate and its private key are encrypted using the password according to the PKCS#12 standard and the resulting binary BLOB is returned as a binary buffer that can be written to a file or transmitted.

If the UseMachineStore parameter is set TRUE, your user account must have administrative privileges.