IMSCSAuthManager::GenerateEncryptionKey

Ee823527.c++_off(en-US,CS.10).gifEe823527.vb_on(en-US,CS.10).gif

Use this method to generate an encryption key for encrypting/decrypting the cookie and query string data used for tickets.

Definition

HRESULT IMSCSAuthManager::GenerateEncryptionKey(BSTR*pbstrRet);

Parameters

pbstrRet

[out, retval] A pointer to a BSTR used to return a copy of the encryption key.

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT 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 0xC1004C26 An error occurred while generating the encryption key using the CryptoAPI.

Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return 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.

The pbstrRet parameter contains valid data only if the method completes successfully.

See Also

AuthManager Object


All rights reserved.