EncryptedKeyEncryptingCredentials 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.
Initializes a new instance of the EncryptedKeyEncryptingCredentials class.
Overloads
EncryptedKeyEncryptingCredentials(X509Certificate2) |
Initializes a new instance of the EncryptedKeyEncryptingCredentials class based on the specified X.509 certificate. |
EncryptedKeyEncryptingCredentials(EncryptingCredentials, Int32, String) |
Initializes a new instance of the EncryptedKeyEncryptingCredentials class based on the specified EncryptingCredentials object, key size, and encryption algorithm. |
EncryptedKeyEncryptingCredentials(X509Certificate2, String, Int32, String) |
Initializes a new instance of the EncryptedKeyEncryptingCredentials class based on the specified X.509 certificate, wrapping algorithm, key size, and encryption algorithm. |
EncryptedKeyEncryptingCredentials(X509Certificate2)
Initializes a new instance of the EncryptedKeyEncryptingCredentials class based on the specified X.509 certificate.
public:
EncryptedKeyEncryptingCredentials(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public EncryptedKeyEncryptingCredentials (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
new System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials : System.Security.Cryptography.X509Certificates.X509Certificate2 -> System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials
Public Sub New (certificate As X509Certificate2)
Parameters
- certificate
- X509Certificate2
The certificate used to encrypt the key.
Remarks
Use this constructor if the wrapping credential is an X.509 certificate and you want to use the default wrapping algorithm and encryption algorithm, which are RSA-OAEP and AES256 respectively.
Applies to
EncryptedKeyEncryptingCredentials(EncryptingCredentials, Int32, String)
Initializes a new instance of the EncryptedKeyEncryptingCredentials class based on the specified EncryptingCredentials object, key size, and encryption algorithm.
public:
EncryptedKeyEncryptingCredentials(System::IdentityModel::Tokens::EncryptingCredentials ^ wrappingCredentials, int keySizeInBits, System::String ^ encryptionAlgorithm);
public EncryptedKeyEncryptingCredentials (System.IdentityModel.Tokens.EncryptingCredentials wrappingCredentials, int keySizeInBits, string encryptionAlgorithm);
new System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials : System.IdentityModel.Tokens.EncryptingCredentials * int * string -> System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials
Public Sub New (wrappingCredentials As EncryptingCredentials, keySizeInBits As Integer, encryptionAlgorithm As String)
Parameters
- wrappingCredentials
- EncryptingCredentials
The key wrapping credentials used to encrypt the session key.
- keySizeInBits
- Int32
The key size of the wrapped session key.
- encryptionAlgorithm
- String
A URI that represents the encryption algorithm when the session key is used. This should be a symmetric key algorithm.
Exceptions
wrappingCredentials
is null
.
Remarks
Use this constructor if you already have an EncryptingCredentials object and you want to use it as a wrapping credential.
Applies to
EncryptedKeyEncryptingCredentials(X509Certificate2, String, Int32, String)
Initializes a new instance of the EncryptedKeyEncryptingCredentials class based on the specified X.509 certificate, wrapping algorithm, key size, and encryption algorithm.
public:
EncryptedKeyEncryptingCredentials(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::String ^ keyWrappingAlgorithm, int keySizeInBits, System::String ^ encryptionAlgorithm);
public EncryptedKeyEncryptingCredentials (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, string keyWrappingAlgorithm, int keySizeInBits, string encryptionAlgorithm);
new System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials : System.Security.Cryptography.X509Certificates.X509Certificate2 * string * int * string -> System.IdentityModel.Tokens.EncryptedKeyEncryptingCredentials
Public Sub New (certificate As X509Certificate2, keyWrappingAlgorithm As String, keySizeInBits As Integer, encryptionAlgorithm As String)
Parameters
- certificate
- X509Certificate2
The certificate used to encrypt the key.
- keyWrappingAlgorithm
- String
A URI that represents the key wrapping algorithm. This should be an asymmetric algorithm.
- keySizeInBits
- Int32
The key size of the wrapped session key.
- encryptionAlgorithm
- String
A URI that represents the encryption algorithm when the session key is used. This should be a symmetric key algorithm.
Remarks
Use this constructor if the wrapping credential is an X.509 certificate and you want to supply your own wrapping algorithm and encryption algorithm.