X509SecurityTokenManager.DefaultKeyAlgorithm Property
Gets or sets the default key algorithm for X509SecurityToken security tokens.
Namespace: Microsoft.Web.Services2.Security.Tokens
Assembly: Microsoft.Web.Services2 (in microsoft.web.services2.dll)
Usage
'Usage
Dim x509SecurityTokenManager1 As X509SecurityTokenManager
Dim returnValue As String
returnValue = x509SecurityTokenManager1.DefaultKeyAlgorithm
Dim sampleValue As String
x509SecurityTokenManager1.DefaultKeyAlgorithm = sampleValue
Syntax
'Declaration
Public Overrides Property DefaultKeyAlgorithm() As String
public override string DefaultKeyAlgorithm {get; set;}
public: property virtual String^ DefaultKeyAlgorithm{
String^ get();
Void set(String^);
}
public System.String get_DefaultKeyAlgorithm();
public void set_DefaultKeyAlgorithm(System.String);
public override function get DefaultKeyAlgorithm() : String;
public override function set DefaultKeyAlgorithm(String);
Property Value
The default key algorithm for X509SecurityToken security tokens.
Example
The following code example shows how to change the default key algorithm for a X509SecurityToken security token to AES256.
Dim stm As ISecurityTokenManager = SecurityTokenManager.GetSecurityTokenManagerByTokenType(WSTrust.TokenTypes.X509v3)
stm.DefaultKeyAlgorithm = "AES256"
Dim token As X509SecurityToken = New X509SecurityToken(x509Certificate)
ISecurityTokenManager stm = SecurityTokenManager.GetSecurityTokenManagerByTokenType(WSTrust.TokenTypes.X509v3);
stm.DefaultKeyAlgorithm = "AES256";
X509SecurityToken token = new X509SecurityToken(x509Certificate);
Exceptions
| Exception type | Condition |
|---|---|
| System.ArgumentNullException | The value for the default key algorithm is not recognized. |
Remarks
If not specified, the value for the default key algorithm is RSA15. Valid values for the default key algorithm are AES128, AES192, AES256, TripleDES, RSA15, and RSAOAEP. RSAOAEP is not supported on versions of Windows that are earlier than Microsoft(r) Windows(r) XP.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Development Platforms
Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, and Windows 2000
Target Platforms
Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, Pocket PC, Windows CE, Smart Phone
See Also
Reference
X509SecurityTokenManager Class
Microsoft.Web.Services2.Security.Tokens Namespace