MLDsa.ImportFromPem 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
| ImportFromPem(ReadOnlySpan<Char>) |
Imports an ML-DSA key from an RFC 7468 PEM-encoded string. |
| ImportFromPem(String) |
Imports an ML-DSA key from an RFC 7468 PEM-encoded string. |
ImportFromPem(ReadOnlySpan<Char>)
- Source:
- MLDsa.cs
- Source:
- MLDsa.cs
Imports an ML-DSA key from an RFC 7468 PEM-encoded string.
public:
static System::Security::Cryptography::MLDsa ^ ImportFromPem(ReadOnlySpan<char> source);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.MLDsa ImportFromPem(ReadOnlySpan<char> source);
public static System.Security.Cryptography.MLDsa ImportFromPem(ReadOnlySpan<char> source);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ImportFromPem : ReadOnlySpan<char> -> System.Security.Cryptography.MLDsa
static member ImportFromPem : ReadOnlySpan<char> -> System.Security.Cryptography.MLDsa
Public Shared Function ImportFromPem (source As ReadOnlySpan(Of Char)) As MLDsa
Parameters
- source
- ReadOnlySpan<Char>
The text of the PEM key to import.
Returns
The imported ML-DSA key.
- Attributes
Exceptions
source contains an encrypted PEM-encoded key.
-or-
source contains multiple PEM-encoded ML-DSA keys.
-or-
source contains no PEM-encoded ML-DSA keys.
An error occurred while importing the key.
The platform does not support ML-DSA. Callers can use the IsSupported property to determine if the platform supports ML-DSA.
Remarks
Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels are found, an exception is raised to prevent importing a key when the key is ambiguous.
This method supports the following PEM labels:
- PUBLIC KEY
- PRIVATE KEY
Applies to
ImportFromPem(String)
- Source:
- MLDsa.cs
Imports an ML-DSA key from an RFC 7468 PEM-encoded string.
public:
static System::Security::Cryptography::MLDsa ^ ImportFromPem(System::String ^ source);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Security.Cryptography.MLDsa ImportFromPem(string source);
public static System.Security.Cryptography.MLDsa ImportFromPem(string source);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ImportFromPem : string -> System.Security.Cryptography.MLDsa
static member ImportFromPem : string -> System.Security.Cryptography.MLDsa
Public Shared Function ImportFromPem (source As String) As MLDsa
Parameters
- source
- String
The text of the PEM key to import.
Returns
The imported ML-DSA key.
- Attributes
Exceptions
source is null.