CreateFromPkcs8 Method
CreateFromPkcs8(ReadOnlyMemory<byte>)
Creates an instance of Curve25519PrivateKey from a PKCS#8 DER-encoded private key.
C#
public static Curve25519PrivateKey CreateFromPkcs8(ReadOnlyMemory<byte> pkcs8EncodedKey)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyMemory<byte> | pkcs8EncodedKey | The DER-encoded private key. |
Returns
A new instance of Curve25519PrivateKey.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if the algorithm OID is not X25519 or Ed25519. |
CryptographicException | Thrown if privateKey does not match expected format. |