Framework EDI Reference. Methods and Properties
ediSecurityKeyContainer. GenerateSessionKey

Generates a session key from the Cryptographic Service Provider (CSP) and exports the session key BLOB to a file.

Syntax:

<lRetVal> = object.GenerateSessionKey(<sAlgorithm>, <sExportFileName>, <KeyPairType>)

Parameters:

Returns

Returns 1 if the operation is successful; otherwise the operation returns zero.

Remarks

A random session key is generated from the Cryptographic Service Provider, and is encrypted using the public key of the key container.  The encrypted key BLOB is extracted from the CSP and is then saved to a file. The algorithm used to encrypt the session key is specified by the sAlgorithm and must be supported by the CSP. If the CSP does not support the encryption algorithm, an error will be generated and this method fails.