Skip to content

OnixLabs.Security.Cryptography.IPrivateKeyRawPemExportable

matthew edited this page May 27, 2026 · 1 revision

IPrivateKeyRawPemExportable Interface

Defines a cryptographic private key that can be exported in its algorithm-native RFC 7468 PEM form.

Namespace OnixLabs.Security.Cryptography
Assembly OnixLabs.Security.Cryptography.dll (NuGet)

Definition

public interface IPrivateKeyRawPemExportable
{
    string ExportPem();
}

Remarks

IPrivateKeyRawPemExportable produces algorithm-native PEM — for example, EC PRIVATE KEY (SEC1 encoding) for ECDSA keys, or RSA PRIVATE KEY (PKCS #1 encoding) for RSA keys. For a format-neutral PKCS #8 PEM (PRIVATE KEY), use IPrivateKeyPkcs8PemExportable instead.

This interface is composed into IPrivateKeyExportable. It is not implemented by IEddsaPrivateKey, which does not have an algorithm-native raw PEM format.

Methods

Member Returns Description
ExportPem() string Exports the key in algorithm-native RFC 7468 PEM format.

ExportPem()

string ExportPem();

Exports the cryptographic private key data in its algorithm-native RFC 7468 PEM format.

Returns — A string containing the RFC 7468 PEM-encoded private key.

See Also

ONIXLabs .NET Library


Clone this wiki locally