ddn.crypto.key.dh
Diffie-Hellman Keys.
Types 2
classDHPublicKey : PublicKey
DH Public Key. Contains the prime modulus p, generator g, and public value y = g^x mod p.
Methods
size_t toHash() constDestructors
classDHPrivateKey : PrivateKey
DH Private Key. Contains the prime modulus p, generator g, and private value x.
Methods
size_t toHash() constDestructors
Functions 7
private fn
ubyte[] bigIntToBytes(BigInt val) @safeConverts a non-negative BigInt to minimal big-endian unsigned bytes.private fn
BigInt bytesToBigInt(const(ubyte)[] bytes) @safeConverts big-endian unsigned bytes to a BigInt.fn
ubyte[] encodeDhSpki(DHPublicKey key)Encodes a DH public key as a DER-encoded SubjectPublicKeyInfo (SPKI).fn
DHPublicKey decodeDhSpki(const(ubyte)[] der)Decodes a DH public key from DER-encoded SubjectPublicKeyInfo (SPKI).fn
ubyte[] encodeDhPkcs8(DHPrivateKey key)Encodes a DH private key in PKCS#8 format (PrivateKeyInfo).fn
DHPrivateKey decodeDhPkcs8(const(ubyte)[] der)Decodes a DH private key from PKCS#8 format (PrivateKeyInfo).