<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Crypto.Parameters.Ed25519PrivateKeyParameters

Ed25519 private key (RFC 8032). Holds the 32-byte secret seed; the corresponding public key is derived lazily on first use and cached.
public static readonly int KeySize

Length in bytes of an Ed25519 private-key seed (32).

public static readonly int SignatureSize

Length in bytes of an Ed25519 signature (64).

Generate a fresh random Ed25519 private key using random.

public Ed25519PrivateKeyParameters(byte[] buf)

Construct from a 32-byte seed buffer.

public Ed25519PrivateKeyParameters(byte[] buf, int off)

Construct from buf at off; reads KeySize bytes.

Read the 32-byte seed from input.

public void Encode(byte[] buf, int off)

Write the 32-byte seed into buf at off.

Derive (and cache) the public key corresponding to this private key.

public byte[] GetEncoded()

Return a fresh copy of the 32-byte seed.

public void Sign(Algorithm algorithm, byte[] ctx, byte[] msg, int msgOff, int msgLen, byte[] sig, int sigOff)

Compute an Ed25519 signature. Selects between pure Ed25519, Ed25519ctx and Ed25519ph based on algorithm. The pure variant rejects a non-null context; the context and prehash variants require a context up to 255 bytes long, and Ed25519ph additionally requires msgLen to equal PrehashSize.