Generates a session key from the Cryptographic Service Provider (CSP) and exports the session key BLOB to a file.
Syntax:
<lretval> = object.GenerateSessionKey(<sExportFileName>, [<sKeyContainer>], [<sServiceProvider>], [<lProviderType>])
Parameters:
Returns
Returns 1 if the task was successful. Otherwise it returns 0.
Remarks
A random session key is generated from the Cryptographic Service Provider, and is encrypted using the key from the destination user, so that only the destination user can use the session key. 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 CALG_RC4 only if the CSP supports it, otherwise another encryption algorithm supported by the CSP will be selected. If the CSP does not support any encryption algorithm, an error will be generated and this method fails.