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

Org.BouncyCastle.Crypto.Parameters.X25519PublicKeyParameters

X25519 public key (RFC 7748). Holds the 32-byte u-coordinate of the peer's curve point. The encoding is stored verbatim; validation of the point is performed during scalar multiplication in the agreement primitive.
public static readonly int KeySize

Length in bytes of an X25519 public key encoding (32).

public X25519PublicKeyParameters(byte[] buf)

Construct from a 32-byte buffer holding the encoded u-coordinate.

public X25519PublicKeyParameters(byte[] buf, int off)

Construct from buf at off; reads KeySize bytes.

Construct from a span holding the encoded u-coordinate.

Read the 32-byte encoded u-coordinate from input.

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

Write the 32-byte encoded u-coordinate into buf at off.

public void Encode(Span<byte> buf)

Write the 32-byte encoded u-coordinate into the supplied span.

public byte[] GetEncoded()

Return a fresh copy of the 32-byte encoded u-coordinate.