Exports the public key of the Key Exchange key pair to a file.
Syntax:
Parameters:
Returns
Returns 1 if the task was successful. Otherwise it returns 0.
Remarks
The Cryptographic Service Provider (CSP) key container contains two key pairs:
1. Exchange Key Pair for encrypting.
2. Signature Key Pair for authenticating.
This method exports the public key from the Exchange Key Pair only. The file contains the actual BLOB extracted from the key container by the CSP.
Example:
Set oSecurities = oEdiDoc.GetSecurities
' Creates a new key container for hypothetical trading partner.
oSecurities.DeleteKeyContainer sKeyContainerName
oSecurities.CreateKeyContainer sKeyContainerName
'Export public key
sPKeyFile = "Recipient.pkey.bin"
oSecurities.ExportPublicKey sPKeyFile, sKeyContainerName