EncryptingCredentials Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
EncryptingCredentials(SymmetricSecurityKey, String) |
Initializes a new instance of the EncryptingCredentials class. |
EncryptingCredentials(SecurityKey, String, String) |
Initializes a new instance of the EncryptingCredentials class. |
EncryptingCredentials(X509Certificate2, String, String) |
Initializes a new instance of the EncryptingCredentials class. |
EncryptingCredentials(SymmetricSecurityKey, String)
Initializes a new instance of the EncryptingCredentials class.
public EncryptingCredentials (Microsoft.IdentityModel.Tokens.SymmetricSecurityKey key, string enc);
new Microsoft.IdentityModel.Tokens.EncryptingCredentials : Microsoft.IdentityModel.Tokens.SymmetricSecurityKey * string -> Microsoft.IdentityModel.Tokens.EncryptingCredentials
Public Sub New (key As SymmetricSecurityKey, enc As String)
Parameters
The SymmetricSecurityKey to use for encryption.
- enc
- String
The encryption algorithm to be used.
Exceptions
Thrown if key
is not a SymmetricSecurityKey.
Thrown if enc
is null or empty.
Remarks
Used in scenarios when a key represents a 'shared' symmetric key. For example, SAML 2.0 Assertion will be encrypted using a provided symmetric key which won't be serialized to a SAML token.
Applies to
EncryptingCredentials(SecurityKey, String, String)
Initializes a new instance of the EncryptingCredentials class.
public EncryptingCredentials (Microsoft.IdentityModel.Tokens.SecurityKey key, string alg, string enc);
new Microsoft.IdentityModel.Tokens.EncryptingCredentials : Microsoft.IdentityModel.Tokens.SecurityKey * string * string -> Microsoft.IdentityModel.Tokens.EncryptingCredentials
Public Sub New (key As SecurityKey, alg As String, enc As String)
Parameters
- key
- SecurityKey
The SecurityKey to use for encryption.
- alg
- String
A key wrap algorithm to use when encrypting a session key.
- enc
- String
The encryption algorithm to be used.
Exceptions
if enc
is null or empty.
Applies to
EncryptingCredentials(X509Certificate2, String, String)
Initializes a new instance of the EncryptingCredentials class.
protected EncryptingCredentials (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, string alg, string enc);
new Microsoft.IdentityModel.Tokens.EncryptingCredentials : System.Security.Cryptography.X509Certificates.X509Certificate2 * string * string -> Microsoft.IdentityModel.Tokens.EncryptingCredentials
Protected Sub New (certificate As X509Certificate2, alg As String, enc As String)
Parameters
- certificate
- X509Certificate2
The X509Certificate2 used to encrypt data.
- alg
- String
A key wrap algorithm to use when encrypting a session key.
- enc
- String
The encryption algorithm to be used.
Exceptions
Thrown if enc
is null or empty.