Exports the Public/Private key pair from Cryptographic Service Provider (CSP) key container to a file.
Syntax:
<lretval> = object. ExportExchangeKeyPair(<sExportFileName>,<sPassword>, [<sKeyContainer>], [<sServiceProvider>], [< lProviderType>])
Parameters:
Returns
Returns 1 if the operation is successful; otherwise returns 0 if the operation fails.
Remarks:
The sServiceProvider and lProviderType specify the CSP that has the key container. If sServiceProvider and/or lProviderType are not specified, the default CSP database is used, which is specified by DefaultProviderName andServiceProviderType. The type of database, whether machine key set or user key set, is specified using ediDocument.Option by the constant OptDocument_MachineKeySet.
Example:
Set oSecurities = oEdiDoc.GetSecurities
' Creates a new key container for hypothetical trading partner.
oSecurities.DeleteKeyContainer sKeyContainerName
oSecurities.CreateKeyContainer sKeyContainerName
'Export private and public key container to a file
oSecurities.ExportExchangeKeyPair sExportFileName, sPassword, sKeyContainerName, sProviderName
Sample