chloride.auth

Members

Aliases

makeAuthKey
alias makeAuthKey = randomArray!AuthKey

Generate a key for use with authentication.

Functions

authenticateMessage
Mac authenticateMessage(in ubyte[] message, in AuthKey key)

Create an authentication Mac for a message, signed with key.

verifyMac
bool verifyMac(in Mac mac, in ubyte[] message, in AuthKey key)

Verify message authentication with a secret key.

Examples

1 import std.string : representation;
2 immutable ubyte[] message = representation("hello");
3 auto key = makeAuthKey();
4 auto mac = authenticateMessage(message, key);
5 assert(verifyMac(mac, message, key));

Meta