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
Constructors
Destructors

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
Constructors
Destructors

Functions 7

private fnvoid zeroBigInt(ref BigInt val) nothrow @nogc @trusted
private fnubyte[] bigIntToBytes(BigInt val) @safeConverts a non-negative BigInt to minimal big-endian unsigned bytes.
private fnBigInt bytesToBigInt(const(ubyte)[] bytes) @safeConverts big-endian unsigned bytes to a BigInt.
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).