Generate a seed that can be used to generate key pairs with makeSigningKeys.
Generate a new random key pair suitable for public key signatures.
Generate a key pair from a seed.
Compute a signature for a message using a private key. Unlike signMessage this does not include the original message.
Verify a signed message using the public key corresponding to the private key used to sign it. If verification succeeds return the message (without the signature), otherwise return null.
Sign a message using a private key by prepending a signature to the message.
Verify a signed message using the public key corresponding to the private key used to sign it. Returns true on success and false on failure. This method is passed the message and signature separately.
1 import std.string : representation; 2 immutable ubyte[] message = representation("hello"); 3 auto keys = makeSigningKeys(); 4 auto signed = signMessage(message, keys.privateKey); 5 assert(openSignedMessage(signed, keys.publicKey) == message);
1 import std.string : representation; 2 immutable ubyte[] message = representation("hello"); 3 auto keys = makeSigningKeys(); 4 auto sig = messageSignature(message, keys.privateKey); 5 assert(verifySignature(message, sig, keys.publicKey));