Base class for HMAC family of algorithms.
More...
#include <goby/util/thirdparty/jwt-cpp/jwt.h>
|
| hmacsha (std::string key, const EVP_MD *(*md)(), std::string name) |
|
std::string | sign (const std::string &data, std::error_code &ec) const |
|
void | verify (const std::string &data, const std::string &signature, std::error_code &ec) const |
|
std::string | name () const |
|
Base class for HMAC family of algorithms.
Definition at line 947 of file jwt.h.
◆ hmacsha()
jwt::algorithm::hmacsha::hmacsha |
( |
std::string |
key, |
|
|
const EVP_MD *(*)() |
md, |
|
|
std::string |
name |
|
) |
| |
|
inline |
Construct new hmac algorithm
- Parameters
-
key | Key to use for HMAC |
md | Pointer to hash function |
name | Name of the algorithm |
Definition at line 955 of file jwt.h.
◆ name()
std::string jwt::algorithm::hmacsha::name |
( |
| ) |
const |
|
inline |
Returns the algorithm name provided to the constructor
- Returns
- algorithm's name
Definition at line 1011 of file jwt.h.
◆ sign()
std::string jwt::algorithm::hmacsha::sign |
( |
const std::string & |
data, |
|
|
std::error_code & |
ec |
|
) |
| const |
|
inline |
Sign jwt data
- Parameters
-
data | The data to sign |
ec | error_code filled with details on error |
- Returns
- HMAC signature for the given data
Definition at line 965 of file jwt.h.
◆ verify()
void jwt::algorithm::hmacsha::verify |
( |
const std::string & |
data, |
|
|
const std::string & |
signature, |
|
|
std::error_code & |
ec |
|
) |
| const |
|
inline |
Check if signature is valid
- Parameters
-
data | The data to check signature against |
signature | Signature provided by the jwt |
ec | Filled with details about failure. |
Definition at line 988 of file jwt.h.
The documentation for this struct was generated from the following file:
- goby/util/thirdparty/jwt-cpp/jwt.h