Share via


AuthManager.GenerateEncryptionKey Method (PIA)

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

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function GenerateEncryptionKey() As String

[C#]

using Microsoft.CommerceServer.Interop;
…
string GenerateEncryptionKey();

Return Values

[Visual Basic .NET] If this method completes successfully, it returns a String that contains the encryption key.

[C#] On a successful return, this method returns an encryption key for encrypting/decrypting the cookie and query string data used for tickets.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

[Visual Basic .NET]

The following table shows the custom COM error that this method can return.

Value Description
&HC1004C26 An error occurred while generating the encryption key using the CryptoAPI.

[C#]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
0xC1004C26 An error occurred while generating the encryption key using the Microsoft Windows CryptoAPI routines.

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 Administration database.

[C#]

This method is one of the few AuthManager methods used in C# applications.

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsauthlib (in mscsauthlib.dll)

See Also

AuthManager Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.