Pkcs12SafeContents.AddShroudedKey Method
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
AddShroudedKey(AsymmetricAlgorithm, String, PbeParameters) |
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a character-based password in a string and returns the newly created bag instance. |
AddShroudedKey(AsymmetricAlgorithm, ReadOnlySpan<Char>, PbeParameters) |
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a character-based password in a span and returns the newly created bag instance. |
AddShroudedKey(AsymmetricAlgorithm, Byte[], PbeParameters) |
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a byte-based password in an array and returns the newly created bag instance. |
AddShroudedKey(AsymmetricAlgorithm, ReadOnlySpan<Byte>, PbeParameters) |
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a byte-based password in a span and returns the newly created bag instance. |
AddShroudedKey(AsymmetricAlgorithm, String, PbeParameters)
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a character-based password in a string and returns the newly created bag instance.
public:
System::Security::Cryptography::Pkcs::Pkcs12ShroudedKeyBag ^ AddShroudedKey(System::Security::Cryptography::AsymmetricAlgorithm ^ key, System::String ^ password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey (System.Security.Cryptography.AsymmetricAlgorithm key, string? password, System.Security.Cryptography.PbeParameters pbeParameters);
public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey (System.Security.Cryptography.AsymmetricAlgorithm key, string password, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddShroudedKey : System.Security.Cryptography.AsymmetricAlgorithm * string * System.Security.Cryptography.PbeParameters -> System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag
Public Function AddShroudedKey (key As AsymmetricAlgorithm, password As String, pbeParameters As PbeParameters) As Pkcs12ShroudedKeyBag
Parameters
The asymmetric private key to add.
- password
- String
The password to use when encrypting the key material.
- pbeParameters
- PbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns
The bag instance which was added to the SafeContents.
Exceptions
The key
parameter is null
.
This instance is read-only.
The key export failed.
See also
Applies to
AddShroudedKey(AsymmetricAlgorithm, ReadOnlySpan<Char>, PbeParameters)
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a character-based password in a span and returns the newly created bag instance.
public:
System::Security::Cryptography::Pkcs::Pkcs12ShroudedKeyBag ^ AddShroudedKey(System::Security::Cryptography::AsymmetricAlgorithm ^ key, ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey (System.Security.Cryptography.AsymmetricAlgorithm key, ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddShroudedKey : System.Security.Cryptography.AsymmetricAlgorithm * ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag
Public Function AddShroudedKey (key As AsymmetricAlgorithm, password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters) As Pkcs12ShroudedKeyBag
Parameters
The asymmetric private key to add.
- password
- ReadOnlySpan<Char>
The password to use when encrypting the key material.
- pbeParameters
- PbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns
The bag instance which was added to the SafeContents.
Exceptions
The key
parameter is null
.
This instance is read-only.
The key export failed.
See also
Applies to
AddShroudedKey(AsymmetricAlgorithm, Byte[], PbeParameters)
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a byte-based password in an array and returns the newly created bag instance.
public:
System::Security::Cryptography::Pkcs::Pkcs12ShroudedKeyBag ^ AddShroudedKey(System::Security::Cryptography::AsymmetricAlgorithm ^ key, cli::array <System::Byte> ^ passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey (System.Security.Cryptography.AsymmetricAlgorithm key, byte[]? passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey (System.Security.Cryptography.AsymmetricAlgorithm key, byte[] passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddShroudedKey : System.Security.Cryptography.AsymmetricAlgorithm * byte[] * System.Security.Cryptography.PbeParameters -> System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag
Public Function AddShroudedKey (key As AsymmetricAlgorithm, passwordBytes As Byte(), pbeParameters As PbeParameters) As Pkcs12ShroudedKeyBag
Parameters
The asymmetric private key to add.
- passwordBytes
- Byte[]
The bytes to use as a password when encrypting the key material.
- pbeParameters
- PbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns
The bag instance which was added to the SafeContents.
Exceptions
The key
parameter is null
.
This instance is read-only.
The key export failed.
See also
Applies to
AddShroudedKey(AsymmetricAlgorithm, ReadOnlySpan<Byte>, PbeParameters)
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
- Source:
- Pkcs12SafeContents.cs
Adds an encrypted asymmetric private key to the SafeContents via a new Pkcs12ShroudedKeyBag from a byte-based password in a span and returns the newly created bag instance.
public:
System::Security::Cryptography::Pkcs::Pkcs12ShroudedKeyBag ^ AddShroudedKey(System::Security::Cryptography::AsymmetricAlgorithm ^ key, ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag AddShroudedKey (System.Security.Cryptography.AsymmetricAlgorithm key, ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
member this.AddShroudedKey : System.Security.Cryptography.AsymmetricAlgorithm * ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag
Public Function AddShroudedKey (key As AsymmetricAlgorithm, passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters) As Pkcs12ShroudedKeyBag
Parameters
The asymmetric private key to add.
- passwordBytes
- ReadOnlySpan<Byte>
The bytes to use as a password when encrypting the key material.
- pbeParameters
- PbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns
The bag instance which was added to the SafeContents.
Exceptions
The key
parameter is null
.
This instance is read-only.
The key export failed.