JSON Web Key.
More...
#include <goby/util/thirdparty/jwt-cpp/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.
Definition at line 3861 of file jwt.h.
◆ jwk() [1/2]
template<typename json_traits >
◆ jwk() [2/2]
template<typename json_traits >
◆ empty()
template<typename json_traits >
Check if the jwk has any claims
- Returns
- true is any claim is present
Definition at line 4052 of file jwt.h.
◆ 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) |
Definition at line 3904 of file jwt.h.
◆ 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
Definition at line 4058 of file jwt.h.
◆ 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 |
Definition at line 4044 of file jwt.h.
◆ 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) |
Definition at line 3912 of file jwt.h.
◆ 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) |
Definition at line 3896 of file jwt.h.
◆ 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) |
Definition at line 3880 of file jwt.h.
◆ 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) |
Definition at line 3888 of file jwt.h.
◆ 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) |
Definition at line 3932 of file jwt.h.
◆ 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) |
Definition at line 3964 of file jwt.h.
◆ 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) |
Definition at line 3948 of file jwt.h.
◆ 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) |
Definition at line 3956 of file jwt.h.
◆ 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) |
Definition at line 3940 of file jwt.h.
◆ has_algorithm()
template<typename json_traits >
Check if algorithm is present ("alg")
- Returns
- true if present, false otherwise
Definition at line 3993 of file jwt.h.
◆ has_curve()
template<typename json_traits >
Check if curve is present ("crv")
- Returns
- true if present, false otherwise
Definition at line 3999 of file jwt.h.
◆ 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
Definition at line 4035 of file jwt.h.
◆ has_key_id()
template<typename json_traits >
Check if key id is present ("kid")
- Returns
- true if present, false otherwise
Definition at line 4005 of file jwt.h.
◆ has_key_operations()
template<typename json_traits >
Check if a key operations parameter is present ("key_ops")
- Returns
- true if present, false otherwise
Definition at line 3987 of file jwt.h.
◆ has_key_type()
template<typename json_traits >
Check if a key type is present ("kty")
- Returns
- true if present, false otherwise
Definition at line 3975 of file jwt.h.
◆ has_use()
template<typename json_traits >
Check if a public key usage indication is present ("use")
- Returns
- true if present, false otherwise
Definition at line 3981 of file jwt.h.
◆ has_x5c()
template<typename json_traits >
Check if X509 Chain is present ("x5c")
- Returns
- true if present, false otherwise
Definition at line 4017 of file jwt.h.
◆ has_x5t()
template<typename json_traits >
Check if a X509 thumbprint is present ("x5t")
- Returns
- true if present, false otherwise
Definition at line 4023 of file jwt.h.
◆ has_x5t_sha256()
template<typename json_traits >
Check if a X509 SHA256 thumbprint is present ("x5t#S256")
- Returns
- true if present, false otherwise
Definition at line 4029 of file jwt.h.
◆ has_x5u()
template<typename json_traits >
Check if X509 URL is present ("x5u")
- Returns
- true if present, false otherwise
Definition at line 4011 of file jwt.h.
The documentation for this class was generated from the following file:
- goby/util/thirdparty/jwt-cpp/jwt.h