Skip to content

OnixLabs.Security.Cryptography.IEddsaPrivateKey

matthew edited this page May 27, 2026 · 1 revision

IEddsaPrivateKey Interface

Defines an EdDSA cryptographic private key, as specified in RFC 8032 (Ed25519, PureEdDSA).

Namespace OnixLabs.Security.Cryptography
Assembly OnixLabs.Security.Cryptography.dll (NuGet)
Implements IPrivateKeyDerivable<EddsaPublicKey>, IPrivateKeyRawImportable<EddsaPrivateKey>, IPrivateKeyPkcs8Importable<EddsaPrivateKey>, IPrivateKeyPemImportable<EddsaPrivateKey>, IPrivateKeyRawExportable, IPrivateKeyPkcs8Exportable, IPrivateKeyPkcs8PemExportable, IBinaryConvertible

Definition

public interface IEddsaPrivateKey :
    IPrivateKeyDerivable<EddsaPublicKey>,
    IPrivateKeyRawImportable<EddsaPrivateKey>,
    IPrivateKeyPkcs8Importable<EddsaPrivateKey>,
    IPrivateKeyPemImportable<EddsaPrivateKey>,
    IPrivateKeyRawExportable,
    IPrivateKeyPkcs8Exportable,
    IPrivateKeyPkcs8PemExportable,
    IBinaryConvertible

Remarks

EdDSA (Ed25519/PureEdDSA) does not use a separate hash step — the algorithm incorporates hashing internally. Accordingly, IEddsaPrivateKey.SignData accepts raw data without an algorithm parameter. The interface also differs from the ECDSA and RSA key interfaces in that it explicitly lists the individual import/export capability interfaces rather than using the composite IPrivateKeyImportable<T> and IPrivateKeyExportable, because EdDSA keys omit the algorithm-native raw PEM export format (IPrivateKeyRawPemExportable).

Methods

Member Returns Description
SignData(ReadOnlySpan<byte>) byte[] Signs a span of bytes.
SignData(ReadOnlySpan<byte>, int, int) byte[] Signs a byte-range slice.
SignData(Stream) byte[] Signs a Stream.
SignData(IBinaryConvertible) byte[] Signs an IBinaryConvertible.

SignData overloads

byte[] SignData(ReadOnlySpan<byte> data);
byte[] SignData(ReadOnlySpan<byte> data, int offset, int count);
byte[] SignData(Stream data);
byte[] SignData(IBinaryConvertible data);

Signs the specified input data. Ed25519 incorporates its own hash function internally, so no hash-algorithm parameter is required.

Parameter Type Description
data ReadOnlySpan<byte> / Stream / IBinaryConvertible The input data to sign.
offset int (slice overload) The offset into the span from which to begin reading.
count int (slice overload) The number of bytes to read from the span.

Returns — A byte[] containing the cryptographic digital signature.

See Also

ONIXLabs .NET Library


Clone this wiki locally