SPSecurity.SetApplicationCendentialKey Method (Microsoft.SharePoint) Home
SPSecurity.SetApplicationCendentialKey Method (Microsoft.SharePoint)
Sets a string that is used in encrypting and decrypting passwords.

Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Syntax

'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.

Remarks

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.

Example

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);
See Also

Community Content

This is not a typo
Added by:Thomas Lee
It really is mispelt that way too in the API!
© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View