AuthManager.GenerateEncryptionKey
Use this method to generate an encryption key for encrypting/decrypting the cookie and query string data used for tickets.
Definition
Function GenerateEncryptionKey() As String
Parameters
None.
Return Values
If this method completes successfully, it returns a String that contains the encryption key.
Error Values
This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
The following table shows the custom COM error that this method can return.
Constant | Value | Description |
E_UPM_AUTHMANAGER_GENERATE_ENCRYPTIONKEY_FAILED | &HC1004C26 | An error occurred while generating the encryption key using the CryptoAPI. |
Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.
Remarks
This method is used by the setup and Commerce Server Site Packager components during installation, and can be used to change the encryption key at a later time.
The encryption key is stored as part of the site configuration resource properties in the Admin database.
This method is one of the few AuthManager methods used in C++ applications.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.