SetApplicationCendentialKey Method
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

SPSecurity.SetApplicationCendentialKey Method

Windows SharePoint Services 3

Sets a string that is used in encrypting and decrypting passwords.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public static void SetApplicationCendentialKey(
	SecureString password
)

Parameters

password
Type: System.Security.SecureString
A SecureString that represents a key that will be used to encrypt and decrypt passwords.

The key passed as the parameter should be long and difficult to guess, just as a password is.

The key is stored in the registry.

Use the same key on all servers in the farm.

Only encrypted passwords are stored in the Windows SharePoint Services 3.0 database.

This example shows how to call the SetApplicationCendentialKey method. You code file will require a using System.Security statement.

String key = "kEy5;("
SecureString secureString = new SecureString();

foreach (char ch in key)
{
    secureString.AppendChar(ch);
}

secureString.MakeReadOnly();
SPSecurity.SetApplicationCendentialKey(secureString);
Show:
© 2016 Microsoft