ddn.crypto.key.x25519

X25519 Keys.

Types 2

X25519 Public Key. Contains the 32-byte u-coordinate (Little Endian).

Fields
ubyte[32] u
Methods
string algorithm() @property const nothrow @safe @nogc pure
string format() @property const nothrow @safe @nogc pure
const(ubyte)[] encoded() @property const @trusted
size_t toHash() const nothrow
bool opEquals(const Key other) const
Constructors
this(const(ubyte)[] uBytes)

X25519 Private Key. Contains the 32-byte secret scalar (Little Endian).

Fields
ubyte[32] scalar
Methods
X25519PrivateKey generate(SecureRandom rng)Generates a random X25519 private key.
X25519PublicKey publicKey() constDerives the public key corresponding to this private key.
string algorithm() @property const nothrow @safe @nogc pure
string format() @property const nothrow @safe @nogc pure
const(ubyte)[] encoded() @property const @trusted
size_t toHash() const nothrow
bool opEquals(const Key other) const
Constructors
this(const(ubyte)[] scalarBytes)
Destructors

Functions 4

fnubyte[] encodeX25519Spki(X25519PublicKey key)Encodes an X25519 public key as DER SubjectPublicKeyInfo (RFC 8410).
fnX25519PublicKey decodeX25519Spki(const(ubyte)[] der)Decodes an X25519 public key from DER SubjectPublicKeyInfo (RFC 8410).
fnubyte[] encodeX25519Pkcs8(X25519PrivateKey key)Encodes an X25519 private key as DER PKCS#8 PrivateKeyInfo (RFC 8410).
fnX25519PrivateKey decodeX25519Pkcs8(const(ubyte)[] der)Decodes an X25519 private key from DER PKCS#8 PrivateKeyInfo (RFC 8410).