Show / Hide Table of Contents

CreateFromPkcs8 Method

CreateFromPkcs8(ReadOnlyMemory<byte>)

Creates a new instance of RSAPrivateKey from a DER-encoded PKCS#8 private key.

C#
public static RSAPrivateKey CreateFromPkcs8(ReadOnlyMemory<byte> encodedKey)

Parameters

Type Name Description
ReadOnlyMemory<byte> encodedKey

The DER-encoded PKCS#8 private key.

Returns

RSAPrivateKey

A new instance of RSAPrivateKey.

Exceptions

Type Condition
CryptographicException

Thrown if the private key is invalid.

NotSupportedException

When the RSA key length is not supported.

In this article
Back to top Generated by DocFX