ddn.api.crypto.key

Key management API.

Types 5

interfaceKey

Top-level interface for all keys.

Methods
string algorithm() @property const;Returns: The standard name of the algorithm associated with this key.
string format() @property const;Returns: The name of the primary encoding format of this key, or null if this key does not support encoding.
const(ubyte)[] encoded() @property const;Returns: The key in its primary encoding format, or null if this key does not support encoding.
size_t toHash() const;Computes a hash of the key material for use as an associative array key.
bool opEquals(const Key other) const;Equality comparison based on key material.
interfaceSecretKey : Key

A secret (symmetric) key.

interfacePublicKey : Key

A public key.

interfacePrivateKey : Key

A private key.

structKeyPair

A container for a public/private key pair.

Note

Both publicKey and privateKey fields may be null. This can occur

when only one half of the key pair is available (e.g., when importing only a public key, or when the private key has been deliberately excluded for security reasons). Callers should check for null before using either field.

Fields
PublicKey publicKey
PrivateKey privateKey