MySQL 8.0.40
Source Code Documentation
|
MCF reader/writer for PBKDF2. More...
#include <kdf_pbkdf2.h>
Public Types | |
using | mcf_type = Pbkdf2McfType |
using | kdf_type = Pbkdf2 |
using | Type = mcf_type::Type |
Public Member Functions | |
Pbkdf2McfAdaptor (Type type, unsigned long rounds, const std::vector< uint8_t > &salt, const std::vector< uint8_t > &checksum) | |
std::string | mcf_id () const |
name of the digest according to MCF. More... | |
std::vector< uint8_t > | checksum () const |
checksum. More... | |
std::vector< uint8_t > | salt () const |
salt. More... | |
Type | digest () const |
unsigned long | rounds () const |
rounds. More... | |
std::string | to_mcf () const |
encode to MCF. More... | |
void | derive (const std::string &key) |
derive a checksum from a key. More... | |
Static Public Member Functions | |
static Pbkdf2McfAdaptor | from_mcf (const std::string &data) |
build PBKDF2 from a MCF notation. More... | |
static std::vector< uint8_t > | base64_decode (const std::string &binary) |
Base64 encode. More... | |
static std::string | base64_encode (const std::vector< uint8_t > &encoded) |
Base64 decode. More... | |
static bool | supports_mcf_id (const std::string mcf_id) |
static std::error_code | validate (const std::string &mcf_line, const std::string &password) |
Static Public Attributes | |
static constexpr unsigned long | kDefaultRounds = 1000 |
rounds if no rounds was specified in from_mcf(). More... | |
static constexpr unsigned long | kMinRounds = 1 |
minimum rounds. More... | |
static constexpr unsigned long | kMaxRounds = 999999999 |
maximum rounds. More... | |
static constexpr size_t | kMaxSaltLength = 16 |
maximum length of the salt. More... | |
Private Attributes | |
Type | type_ |
unsigned long | rounds_ |
std::vector< uint8_t > | salt_ |
std::vector< uint8_t > | checksum_ |
MCF reader/writer for PBKDF2.
using Pbkdf2McfAdaptor::kdf_type = Pbkdf2 |
using Pbkdf2McfAdaptor::Type = mcf_type::Type |
|
inline |
|
static |
Base64 encode.
Variant of RFC... with a different alphabet
|
static |
Base64 decode.
Variant of RFC... with a different alphabet
|
inline |
checksum.
RFC4648 base64 encoded
|
inline |
derive a checksum from a key.
updates checksum
|
inline |
|
static |
build PBKDF2 from a MCF notation.
prefix : pbkdf2_sha256|pbkdf2_sha512
rounds : [1-9][0-9]*
salt : [^$]*
checksum : [./a-zA-Z0-0]*
|
inline |
name of the digest according to MCF.
|
inline |
rounds.
rounds the hash will be applied on itself.
|
inline |
salt.
|
inlinestatic |
std::string Pbkdf2McfAdaptor::to_mcf | ( | ) | const |
encode to MCF.
MCF (Modular Crypt Format)
|
inlinestatic |
|
private |
|
staticconstexpr |
rounds if no rounds was specified in from_mcf().
|
staticconstexpr |
maximum rounds.
|
staticconstexpr |
maximum length of the salt.
only the first kMaxSaltLength bytes of the salt will be used.
|
staticconstexpr |
minimum rounds.
|
private |
|
private |
|
private |