CryptoAuth
class CryptoAuth
libsodium wrapper class for authentication-only crypto
Methods
static int
KeyLength()
Returns the length of a key for use with this class
static string
GenerateKey()
Generates a crypto key for use with this class
static string
MakeAuthCode(string $message, string $key)
Creates an authentication code (MAC) from a message and key
static bool
TryCheckAuthCode(string $mac, string $message, string $key)
Tries to authenticate a message using a secret key
static void
CheckAuthCode(string $mac, string $message, string $key)
Same as TryCheckAuthCode() but throws an exception on failure
Details
at line 151
static int
KeyLength()
Returns the length of a key for use with this class
at line 154
static string
GenerateKey()
Generates a crypto key for use with this class
at line 162
static string
MakeAuthCode(string $message, string $key)
Creates an authentication code (MAC) from a message and key
at line 176
static bool
TryCheckAuthCode(string $mac, string $message, string $key)
Tries to authenticate a message using a secret key
at line 188
static void
CheckAuthCode(string $mac, string $message, string $key)
Same as TryCheckAuthCode() but throws an exception on failure