JSON Web Key.
More...
#include <jwt.h>
template<typename json_traits>
class jwt::jwk< json_traits >
JSON Web Key.
https://tools.ietf.org/html/rfc7517
A JSON object that represents a cryptographic key. The members of the object represent properties of the key, including its value.
◆ empty()
template<typename json_traits >
bool jwt::jwk< json_traits >::empty |
( |
| ) |
const |
|
inlinenoexcept |
Check if the jwk has any claims
- Returns
- true is any claim is present
◆ get_algorithm()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_algorithm |
( |
| ) |
const |
|
inline |
Get algorithm claim
- Returns
- algorithm as string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_claims()
template<typename json_traits >
json_traits::object_type jwt::jwk< json_traits >::get_claims |
( |
| ) |
const |
|
inline |
Get all jwk claims
- Returns
- Map of claims
◆ get_curve()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_curve |
( |
| ) |
const |
|
inline |
◆ get_jwk_claim()
template<typename json_traits >
basic_claim_t jwt::jwk< json_traits >::get_jwk_claim |
( |
const typename json_traits::string_type & | name | ) |
const |
|
inline |
Get jwk claim by name
- Returns
- Requested claim
- Exceptions
-
std::runtime_error | If claim was not present |
◆ get_key_id()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_key_id |
( |
| ) |
const |
|
inline |
Get key id claim
- Returns
- key id as string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_key_operations()
template<typename json_traits >
Get key operation types claim
- Returns
- key operation types as a set of strings
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_key_type()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_key_type |
( |
| ) |
const |
|
inline |
Get key type claim
This returns the general type (e.g. RSA or EC), not a specific algorithm value.
- Returns
- key type as string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_use()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_use |
( |
| ) |
const |
|
inline |
Get public key usage claim
- Returns
- usage parameter as string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_x5c()
template<typename json_traits >
json_traits::array_type jwt::jwk< json_traits >::get_x5c |
( |
| ) |
const |
|
inline |
Get x5c claim
- Returns
- x5c as an array
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a array (Should not happen in a valid token) |
◆ get_x5c_key_value()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_x5c_key_value |
( |
| ) |
const |
|
inline |
Get x5c claim as a string
- Returns
- x5c as an string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_x5t()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_x5t |
( |
| ) |
const |
|
inline |
Get X509 thumbprint claim
- Returns
- x5t as string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_x5t_sha256()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_x5t_sha256 |
( |
| ) |
const |
|
inline |
Get X509 SHA256 thumbprint claim
- Returns
- x5t::S256 as string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ get_x5u()
template<typename json_traits >
json_traits::string_type jwt::jwk< json_traits >::get_x5u |
( |
| ) |
const |
|
inline |
Get X509 URL claim
- Returns
- x5u as string
- Exceptions
-
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a string (Should not happen in a valid token) |
◆ has_algorithm()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_algorithm |
( |
| ) |
const |
|
inlinenoexcept |
Check if algorithm is present ("alg")
- Returns
- true if present, false otherwise
◆ has_curve()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_curve |
( |
| ) |
const |
|
inlinenoexcept |
Check if curve is present ("crv")
- Returns
- true if present, false otherwise
◆ has_jwk_claim()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_jwk_claim |
( |
const typename json_traits::string_type & | name | ) |
const |
|
inlinenoexcept |
Check if a jwk claim is present
- Returns
- true if claim was present, false otherwise
◆ has_key_id()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_key_id |
( |
| ) |
const |
|
inlinenoexcept |
Check if key id is present ("kid")
- Returns
- true if present, false otherwise
◆ has_key_operations()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_key_operations |
( |
| ) |
const |
|
inlinenoexcept |
Check if a key operations parameter is present ("key_ops")
- Returns
- true if present, false otherwise
◆ has_key_type()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_key_type |
( |
| ) |
const |
|
inlinenoexcept |
Check if a key type is present ("kty")
- Returns
- true if present, false otherwise
◆ has_use()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_use |
( |
| ) |
const |
|
inlinenoexcept |
Check if a public key usage indication is present ("use")
- Returns
- true if present, false otherwise
◆ has_x5c()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_x5c |
( |
| ) |
const |
|
inlinenoexcept |
Check if X509 Chain is present ("x5c")
- Returns
- true if present, false otherwise
◆ has_x5t()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_x5t |
( |
| ) |
const |
|
inlinenoexcept |
Check if a X509 thumbprint is present ("x5t")
- Returns
- true if present, false otherwise
◆ has_x5t_sha256()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_x5t_sha256 |
( |
| ) |
const |
|
inlinenoexcept |
Check if a X509 SHA256 thumbprint is present ("x5t#S256")
- Returns
- true if present, false otherwise
◆ has_x5u()
template<typename json_traits >
bool jwt::jwk< json_traits >::has_x5u |
( |
| ) |
const |
|
inlinenoexcept |
Check if X509 URL is present ("x5u")
- Returns
- true if present, false otherwise
The documentation for this class was generated from the following file: