ddn.crypto.key.dh

Diffie-Hellman Keys.

Types 2

DH Public Key. Contains the prime modulus p, generator g, and public value y = g^x mod p.

Fields
Methods
string algorithm() @property const nothrow @safe @nogc pure
string format() @property const nothrow @safe @nogc pure
const(ubyte)[] encoded() @property const
size_t toHash() const
bool opEquals(const Key other) const
void wipe() nothrow @nogc @trustedZeroizes p, g, and y in place.
Constructors

DH Private Key. Contains the prime modulus p, generator g, and private value x.

Fields
Methods
string algorithm() @property const nothrow @safe @nogc pure
string format() @property const nothrow @safe @nogc pure
const(ubyte)[] encoded() @property const
size_t toHash() const
bool opEquals(const Key other) const
void wipe() nothrow @nogc @trustedZeroizes p, g, and the private value x in place.
Constructors

Functions 5

private fnubyte[] dhIntegerTlv(BigInt value)Wraps a non-negative DH parameter in a complete DER INTEGER TLV.
fnubyte[] encodeDhSpki(DHPublicKey key)Encodes a DH public key as a DER-encoded SubjectPublicKeyInfo (SPKI).
fnDHPublicKey decodeDhSpki(const(ubyte)[] der)Decodes a DH public key from DER-encoded SubjectPublicKeyInfo (SPKI).
fnubyte[] encodeDhPkcs8(DHPrivateKey key)Encodes a DH private key in PKCS#8 format (PrivateKeyInfo).
fnDHPrivateKey decodeDhPkcs8(const(ubyte)[] der)Decodes a DH private key from PKCS#8 format (PrivateKeyInfo).