Sets a string that is used in encrypting and decrypting passwords.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
'Usage
Dim password As SecureString
SPSecurity.SetApplicationCendentialKey(password)
'Declaration
Public Shared Sub SetApplicationCendentialKey ( _
password As SecureString _
)
Parameters
- password
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);