MLKem.ImportEncapsulationKey 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
| ImportEncapsulationKey(MLKemAlgorithm, Byte[]) |
Imports an ML-KEM key from a encapsulation key. |
| ImportEncapsulationKey(MLKemAlgorithm, ReadOnlySpan<Byte>) |
Imports an ML-KEM key from a encapsulation key. |
ImportEncapsulationKey(MLKemAlgorithm, Byte[])
- Source:
- MLKem.cs
- Source:
- MLKem.cs
Imports an ML-KEM key from a encapsulation key.
public:
static System::Security::Cryptography::MLKem ^ ImportEncapsulationKey(System::Security::Cryptography::MLKemAlgorithm ^ algorithm, cli::array <System::Byte> ^ source);
public static System.Security.Cryptography.MLKem ImportEncapsulationKey(System.Security.Cryptography.MLKemAlgorithm algorithm, byte[] source);
static member ImportEncapsulationKey : System.Security.Cryptography.MLKemAlgorithm * byte[] -> System.Security.Cryptography.MLKem
Public Shared Function ImportEncapsulationKey (algorithm As MLKemAlgorithm, source As Byte()) As MLKem
Parameters
- algorithm
- MLKemAlgorithm
The specific ML-KEM algorithm for this key.
- source
- Byte[]
The encapsulation key.
Returns
The imported key.
Exceptions
source has a length that is not valid for the ML-KEM algorithm.
An error occurred while importing the key.
The platform does not support ML-KEM. Callers can use the IsSupported property to determine if the platform supports ML-KEM.
Applies to
ImportEncapsulationKey(MLKemAlgorithm, ReadOnlySpan<Byte>)
- Source:
- MLKem.cs
- Source:
- MLKem.cs
Imports an ML-KEM key from a encapsulation key.
public:
static System::Security::Cryptography::MLKem ^ ImportEncapsulationKey(System::Security::Cryptography::MLKemAlgorithm ^ algorithm, ReadOnlySpan<System::Byte> source);
public static System.Security.Cryptography.MLKem ImportEncapsulationKey(System.Security.Cryptography.MLKemAlgorithm algorithm, ReadOnlySpan<byte> source);
static member ImportEncapsulationKey : System.Security.Cryptography.MLKemAlgorithm * ReadOnlySpan<byte> -> System.Security.Cryptography.MLKem
Public Shared Function ImportEncapsulationKey (algorithm As MLKemAlgorithm, source As ReadOnlySpan(Of Byte)) As MLKem
Parameters
- algorithm
- MLKemAlgorithm
The specific ML-KEM algorithm for this key.
- source
- ReadOnlySpan<Byte>
The encapsulation key.
Returns
The imported key.
Exceptions
source has a length that is not valid for the ML-KEM algorithm.
algorithm is null
An error occurred while importing the key.
The platform does not support ML-KEM. Callers can use the IsSupported property to determine if the platform supports ML-KEM.