Skip to content

OnixLabs.Security.Cryptography.IEddsaPublicKey

matthew edited this page May 27, 2026 · 1 revision

IEddsaPublicKey Interface

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

Namespace OnixLabs.Security.Cryptography
Assembly OnixLabs.Security.Cryptography.dll (NuGet)
Implements IPublicKeyImportable<EddsaPublicKey>, IPublicKeyExportable, IBinaryConvertible

Definition

public interface IEddsaPublicKey :
    IPublicKeyImportable<EddsaPublicKey>,
    IPublicKeyExportable,
    IBinaryConvertible

Remarks

IEddsaPublicKey follows the same IsDataValid / VerifyData pattern as IEcdsaPublicKey but omits the HashAlgorithm/HashAlgorithmName and DSASignatureFormat parameters — Ed25519 incorporates its own hash function and produces a fixed-format signature. There is no IsHashValid / VerifyHash family because EdDSA does not expose an intermediate hash step.

Methods

Member Returns Description
IsDataValid(ReadOnlySpan<byte>, ReadOnlySpan<byte>) bool Checks if a span was signed with the given raw signature.
IsDataValid(ReadOnlySpan<byte>, ReadOnlySpan<byte>, int, int) bool Checks if a byte-range slice was signed with the given raw signature.
IsDataValid(ReadOnlySpan<byte>, Stream) bool Checks if a stream was signed with the given raw signature.
IsDataValid(ReadOnlySpan<byte>, IBinaryConvertible) bool Checks if an IBinaryConvertible was signed with the given raw signature.
IsDataValid(DigitalSignature, ReadOnlySpan<byte>) bool Checks if a span was signed with a DigitalSignature.
IsDataValid(DigitalSignature, ReadOnlySpan<byte>, int, int) bool Checks if a byte-range slice was signed with a DigitalSignature.
IsDataValid(DigitalSignature, Stream) bool Checks if a stream was signed with a DigitalSignature.
IsDataValid(DigitalSignature, IBinaryConvertible) bool Checks if an IBinaryConvertible was signed with a DigitalSignature.
VerifyData(ReadOnlySpan<byte>, ReadOnlySpan<byte>) void Verifies a span with a raw signature; throws on failure.
VerifyData(ReadOnlySpan<byte>, ReadOnlySpan<byte>, int, int) void Verifies a byte-range slice with a raw signature; throws on failure.
VerifyData(ReadOnlySpan<byte>, Stream) void Verifies a stream with a raw signature; throws on failure.
VerifyData(ReadOnlySpan<byte>, IBinaryConvertible) void Verifies an IBinaryConvertible with a raw signature; throws on failure.
VerifyData(DigitalSignature, ReadOnlySpan<byte>) void Verifies a span with a DigitalSignature; throws on failure.
VerifyData(DigitalSignature, ReadOnlySpan<byte>, int, int) void Verifies a byte-range slice with a DigitalSignature; throws on failure.
VerifyData(DigitalSignature, Stream) void Verifies a stream with a DigitalSignature; throws on failure.
VerifyData(DigitalSignature, IBinaryConvertible) void Verifies an IBinaryConvertible with a DigitalSignature; throws on failure.

IsDataValid overloads

bool IsDataValid(ReadOnlySpan<byte> signature, ReadOnlySpan<byte> data);
bool IsDataValid(ReadOnlySpan<byte> signature, ReadOnlySpan<byte> data, int offset, int count);
bool IsDataValid(ReadOnlySpan<byte> signature, Stream data);
bool IsDataValid(ReadOnlySpan<byte> signature, IBinaryConvertible data);
bool IsDataValid(DigitalSignature signature, ReadOnlySpan<byte> data);
bool IsDataValid(DigitalSignature signature, ReadOnlySpan<byte> data, int offset, int count);
bool IsDataValid(DigitalSignature signature, Stream data);
bool IsDataValid(DigitalSignature signature, IBinaryConvertible data);

Determines whether the specified data and signature pair was produced by the EdDSA private key corresponding to this public key.

Parameter Type Description
signature ReadOnlySpan<byte> or DigitalSignature The signature to validate.
data ReadOnlySpan<byte> / Stream / IBinaryConvertible The unsigned data to validate.
offset int (slice overloads) The offset into the span from which to begin reading.
count int (slice overloads) The number of bytes to read from the span.

Returns — true if the signature is valid for the supplied data; otherwise false.


VerifyData overloads

void VerifyData(ReadOnlySpan<byte> signature, ReadOnlySpan<byte> data);
void VerifyData(ReadOnlySpan<byte> signature, ReadOnlySpan<byte> data, int offset, int count);
void VerifyData(ReadOnlySpan<byte> signature, Stream data);
void VerifyData(ReadOnlySpan<byte> signature, IBinaryConvertible data);
void VerifyData(DigitalSignature signature, ReadOnlySpan<byte> data);
void VerifyData(DigitalSignature signature, ReadOnlySpan<byte> data, int offset, int count);
void VerifyData(DigitalSignature signature, Stream data);
void VerifyData(DigitalSignature signature, IBinaryConvertible data);

Verifies that the specified data was signed by the EdDSA private key corresponding to this public key. Throws if verification fails.

Parameters match those of the IsDataValid overloads above.

Exceptions — Throws (implementation-defined, typically CryptographicException) if the signature is not valid for the supplied data and key.

See Also

ONIXLabs .NET Library


Clone this wiki locally