MLKem.ImportDecapsulationKey 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
| ImportDecapsulationKey(MLKemAlgorithm, Byte[]) | Imports an ML-KEM key from a decapsulation key. | 
| ImportDecapsulationKey(MLKemAlgorithm, ReadOnlySpan<Byte>) | Imports an ML-KEM key from a decapsulation key. | 
ImportDecapsulationKey(MLKemAlgorithm, Byte[])
- Source:
- MLKem.cs
- Source:
- MLKem.cs
Imports an ML-KEM key from a decapsulation key.
public:
 static System::Security::Cryptography::MLKem ^ ImportDecapsulationKey(System::Security::Cryptography::MLKemAlgorithm ^ algorithm, cli::array <System::Byte> ^ source);public static System.Security.Cryptography.MLKem ImportDecapsulationKey(System.Security.Cryptography.MLKemAlgorithm algorithm, byte[] source);static member ImportDecapsulationKey : System.Security.Cryptography.MLKemAlgorithm * byte[] -> System.Security.Cryptography.MLKemPublic Shared Function ImportDecapsulationKey (algorithm As MLKemAlgorithm, source As Byte()) As MLKemParameters
- algorithm
- MLKemAlgorithm
The specific ML-KEM algorithm for this key.
- source
- Byte[]
The decapsulation 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
ImportDecapsulationKey(MLKemAlgorithm, ReadOnlySpan<Byte>)
- Source:
- MLKem.cs
- Source:
- MLKem.cs
Imports an ML-KEM key from a decapsulation key.
public:
 static System::Security::Cryptography::MLKem ^ ImportDecapsulationKey(System::Security::Cryptography::MLKemAlgorithm ^ algorithm, ReadOnlySpan<System::Byte> source);public static System.Security.Cryptography.MLKem ImportDecapsulationKey(System.Security.Cryptography.MLKemAlgorithm algorithm, ReadOnlySpan<byte> source);static member ImportDecapsulationKey : System.Security.Cryptography.MLKemAlgorithm * ReadOnlySpan<byte> -> System.Security.Cryptography.MLKemPublic Shared Function ImportDecapsulationKey (algorithm As MLKemAlgorithm, source As ReadOnlySpan(Of Byte)) As MLKemParameters
- algorithm
- MLKemAlgorithm
The specific ML-KEM algorithm for this key.
- source
- ReadOnlySpan<Byte>
The decapsulation 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.