+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
▼Njsoncons | |
Cjson_type_traits< Json, jwt::traits::danielaparker_jsoncons::array_type > | |
Cjson_type_traits< Json, jwt::traits::danielaparker_jsoncons::object_type > | |
▼Njwt | JSON Web Token |
▼Nalgorithm | Various cryptographic algorithms when working with JWT |
Cecdsa | Base class for ECDSA family of algorithms |
Ced25519 | |
Ced448 | |
Ceddsa | Base class for EdDSA family of algorithms |
Ces256 | |
Ces256k | |
Ces384 | |
Ces512 | |
Chmacsha | Base class for HMAC family of algorithms |
Chs256 | |
Chs384 | |
Chs512 | |
Cnone | "none" algorithm |
Cps256 | |
Cps384 | |
Cps512 | |
Cpss | Base class for PSS-RSA family of algorithms |
Crs256 | |
Crs384 | |
Crs512 | |
Crsa | Base class for RSA family of algorithms |
▼Nalphabet | Character maps when encoding and decoding |
▼Nhelper | |
Cbase64url_percent_encoding | A General purpose base64url alphabet respecting the URI Case Normalization |
Cbase64 | Valid list of character when working with Base64 |
Cbase64url | Valid list of character when working with Base64URL |
▼Nerror | Everything related to error codes issued by the library |
Cclaim_not_present_exception | |
Cecdsa_exception | |
Cinvalid_json_exception | |
Crsa_exception | |
Csignature_generation_exception | |
Csignature_verification_exception | |
Ctoken_verification_exception | |
▼Nhelper | A collection for working with certificates |
Cevp_pkey_handle | Handle class for EVP_PKEY structures |
▼Ntraits | Namespace containing all the json_trait implementations for a jwt::basic_claim |
Cboost_json | Basic_claim's JSON trait implementation for Boost.JSON |
▼Cdanielaparker_jsoncons | Basic_claim's JSON trait implementation for jsoncons |
Carray_type | |
Cobject_type | |
Ckazuho_picojson | Basic_claim's JSON trait implementation for picojson |
Cnlohmann_json | Basic_claim's JSON trait implementation for Modern C++ JSON |
▼Copen_source_parsers_jsoncpp | Basic_claim's JSON trait implementation for jsoncpp |
Carray_type | |
Cobject_type | |
▼Nverify_ops | |
Cdate_after_claim | |
Cdate_before_claim | |
Cequals_claim | |
Cinsensitive_string_claim | |
Cis_subset_claim | |
Cverify_context | |
Cbasic_claim | Class to store a generic JSON value as claim |
Cbuilder | |
Cdecoded_jwt | |
Cdefault_clock | |
Cheader | |
Cjwk | JSON Web Key |
Cjwks | JWK Set |
Cpayload | |
Cverifier |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::basic_claim< json_traits >, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
a class to store a generic JSON value as claim + More...
+ +#include <jwt.h>
+Public Types | |
using | set_t = std::set<typename json_traits::string_type> |
+Public Member Functions | |
+ | basic_claim (const basic_claim &)=default |
+ | basic_claim (basic_claim &&)=default |
+basic_claim & | operator= (const basic_claim &)=default |
+basic_claim & | operator= (basic_claim &&)=default |
+JWT_CLAIM_EXPLICIT | basic_claim (typename json_traits::string_type s) |
+JWT_CLAIM_EXPLICIT | basic_claim (const date &d) |
+JWT_CLAIM_EXPLICIT | basic_claim (typename json_traits::array_type a) |
+JWT_CLAIM_EXPLICIT | basic_claim (typename json_traits::value_type v) |
+JWT_CLAIM_EXPLICIT | basic_claim (const set_t &s) |
+template<typename Iterator > | |
basic_claim (Iterator begin, Iterator end) | |
json_traits::value_type | to_json () const |
std::istream & | operator>> (std::istream &is) |
std::ostream & | operator<< (std::ostream &os) |
json::type | get_type () const |
json_traits::string_type | as_string () const |
date | as_date () const |
Get the contained JSON value as a date. | |
json_traits::array_type | as_array () const |
set_t | as_set () const |
json_traits::integer_type | as_integer () const |
json_traits::boolean_type | as_boolean () const |
json_traits::number_type | as_number () const |
a class to store a generic JSON value as claim
+json_traits | : JSON implementation traits |
using jwt::basic_claim< json_traits >::set_t = std::set<typename json_traits::string_type> | +
Order list of strings
+ +
+
|
+ +inline | +
Get the contained JSON value as an array
std::bad_cast | Content was not an array |
+
|
+ +inline | +
Get the contained JSON value as a bool
std::bad_cast | Content was not a bool |
+
|
+ +inline | +
Get the contained JSON value as a date.
+If the value is a decimal, it is rounded to the closest integer
+std::bad_cast | Content was not a date |
+
|
+ +inline | +
Get the contained JSON value as an integer
std::bad_cast | Content was not an int |
+
|
+ +inline | +
Get the contained JSON value as a number
std::bad_cast | Content was not a number |
+
|
+ +inline | +
Get the contained JSON value as a set of strings
std::bad_cast | Content was not an array of string |
+
|
+ +inline | +
Get the contained JSON value as a string
std::bad_cast | Content was not a string |
+
|
+ +inline | +
Get type of contained JSON value
std::logic_error | An internal error occurred |
+
|
+ +inline | +
Serialize claim to output stream from wrapped JSON value
+
|
+ +inline | +
Parse input stream into underlying JSON value
+
|
+ +inline | +
Get wrapped JSON value
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::builder< Clock, json_traits >, including all inherited members.
+builder(Clock c) | jwt::builder< Clock, json_traits > | inline |
set_algorithm(typename json_traits::string_type str) | jwt::builder< Clock, json_traits > | inline |
set_audience(typename json_traits::array_type a) | jwt::builder< Clock, json_traits > | inline |
set_audience(typename json_traits::string_type aud) | jwt::builder< Clock, json_traits > | inline |
set_content_type(typename json_traits::string_type str) | jwt::builder< Clock, json_traits > | inline |
set_expires_at(const date &d) | jwt::builder< Clock, json_traits > | inline |
set_expires_in(const std::chrono::duration< Rep > &d) | jwt::builder< Clock, json_traits > | inline |
set_header_claim(const typename json_traits::string_type &id, typename json_traits::value_type c) | jwt::builder< Clock, json_traits > | inline |
set_header_claim(const typename json_traits::string_type &id, basic_claim< json_traits > c) | jwt::builder< Clock, json_traits > | inline |
set_id(const typename json_traits::string_type &str) | jwt::builder< Clock, json_traits > | inline |
set_issued_at(const date &d) | jwt::builder< Clock, json_traits > | inline |
set_issued_now() | jwt::builder< Clock, json_traits > | inline |
set_issuer(typename json_traits::string_type str) | jwt::builder< Clock, json_traits > | inline |
set_key_id(typename json_traits::string_type str) | jwt::builder< Clock, json_traits > | inline |
set_not_before(const date &d) | jwt::builder< Clock, json_traits > | inline |
set_payload_claim(const typename json_traits::string_type &id, typename json_traits::value_type c) | jwt::builder< Clock, json_traits > | inline |
set_payload_claim(const typename json_traits::string_type &id, basic_claim< json_traits > c) | jwt::builder< Clock, json_traits > | inline |
set_subject(typename json_traits::string_type str) | jwt::builder< Clock, json_traits > | inline |
set_type(typename json_traits::string_type str) | jwt::builder< Clock, json_traits > | inline |
sign(const Algo &algo, Encode encode) const | jwt::builder< Clock, json_traits > | inline |
sign(const Algo &algo) const | jwt::builder< Clock, json_traits > | inline |
sign(const Algo &algo, Encode encode, std::error_code &ec) const | jwt::builder< Clock, json_traits > | inline |
sign(const Algo &algo, std::error_code &ec) const | jwt::builder< Clock, json_traits > | inline |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
#include <jwt.h>
+Public Member Functions | |
JWT_CLAIM_EXPLICIT | builder (Clock c) |
builder & | set_header_claim (const typename json_traits::string_type &id, typename json_traits::value_type c) |
builder & | set_header_claim (const typename json_traits::string_type &id, basic_claim< json_traits > c) |
builder & | set_payload_claim (const typename json_traits::string_type &id, typename json_traits::value_type c) |
builder & | set_payload_claim (const typename json_traits::string_type &id, basic_claim< json_traits > c) |
builder & | set_algorithm (typename json_traits::string_type str) |
Set algorithm claim You normally don't need to do this, as the algorithm is automatically set if you don't change it. | |
builder & | set_type (typename json_traits::string_type str) |
builder & | set_content_type (typename json_traits::string_type str) |
builder & | set_key_id (typename json_traits::string_type str) |
Set key id claim. | |
builder & | set_issuer (typename json_traits::string_type str) |
builder & | set_subject (typename json_traits::string_type str) |
builder & | set_audience (typename json_traits::array_type a) |
builder & | set_audience (typename json_traits::string_type aud) |
builder & | set_expires_at (const date &d) |
template<class Rep > | |
builder & | set_expires_in (const std::chrono::duration< Rep > &d) |
builder & | set_not_before (const date &d) |
builder & | set_issued_at (const date &d) |
builder & | set_issued_now () |
builder & | set_id (const typename json_traits::string_type &str) |
template<typename Algo , typename Encode > | |
json_traits::string_type | sign (const Algo &algo, Encode encode) const |
template<typename Algo > | |
json_traits::string_type | sign (const Algo &algo) const |
template<typename Algo , typename Encode > | |
json_traits::string_type | sign (const Algo &algo, Encode encode, std::error_code &ec) const |
template<typename Algo > | |
json_traits::string_type | sign (const Algo &algo, std::error_code &ec) const |
Builder class to build and sign a new token Use jwt::create() to get an instance of this class.
+
+
|
+ +inline | +
Constructor for building a new builder instance
c | Clock instance |
+
|
+ +inline | +
Set algorithm claim You normally don't need to do this, as the algorithm is automatically set if you don't change it.
+str | Name of algorithm |
+
|
+ +inline | +
Set audience claim
a | Audience set |
+
|
+ +inline | +
Set audience claim
aud | Single audience |
+
|
+ +inline | +
Set content type claim
str | Type to set |
+
|
+ +inline | +
Set expires at claim
d | Expires time |
+
|
+ +inline | +
Set expires at claim to d
from the current moment
d | token expiration timeout |
+
|
+ +inline | +
Set a header claim.
id | Name of the claim |
c | Claim to add |
+
|
+ +inline | +
Set a header claim.
id | Name of the claim |
c | Claim to add |
+
|
+ +inline | +
Set id claim
str | ID to set |
+
|
+ +inline | +
Set issued at claim
d | Issued at time, should be current time |
+
|
+ +inline | +
Set issued at claim to the current moment
+
|
+ +inline | +
Set issuer claim
str | Issuer to set |
+
|
+ +inline | +
Set key id claim.
+str | Key id to set |
+
|
+ +inline | +
Set not before claim
d | First valid time |
+
|
+ +inline | +
Set a payload claim.
id | Name of the claim |
c | Claim to add |
+
|
+ +inline | +
Set a payload claim.
id | Name of the claim |
c | Claim to add |
+
|
+ +inline | +
Set subject claim
str | Subject to set |
+
|
+ +inline | +
Set type claim
str | Type to set |
+
|
+ +inline | +
Sign token and return result
+using the jwt::base
functions provided
algo | Instance of an algorithm to sign the token with |
+
|
+ +inline | +
Sign token and return result
Algo | Callable method which takes a string_type and return the signed input as a string_type |
Encode | Callable method which takes a string_type and base64url safe encodes it, MUST return the result with no padding; trim the result. |
algo | Instance of an algorithm to sign the token with |
encode | Callable to transform the serialized json to base64 with no padding |
algo.name()
+
|
+ +inline | +
Sign token and return result
Algo | Callable method which takes a string_type and return the signed input as a string_type |
Encode | Callable method which takes a string_type and base64url safe encodes it, MUST return the result with no padding; trim the result. |
algo | Instance of an algorithm to sign the token with |
encode | Callable to transform the serialized json to base64 with no padding |
ec | error_code filled with details on error |
algo.name()
+
|
+ +inline | +
Sign token and return result
+using the jwt::base
functions provided
algo | Instance of an algorithm to sign the token with |
ec | error_code filled with details on error |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::decoded_jwt< json_traits >, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
#include <jwt.h>
+Public Types | |
+using | basic_claim_t = basic_claim<json_traits> |
![]() | |
+using | basic_claim_t = basic_claim<json_traits> |
![]() | |
+using | basic_claim_t = basic_claim<json_traits> |
+Public Member Functions | |
JWT_CLAIM_EXPLICIT | decoded_jwt (const typename json_traits::string_type &token) |
Parses a given token. | |
template<typename Decode > | |
decoded_jwt (const typename json_traits::string_type &token, Decode decode) | |
Parses a given token. | |
const json_traits::string_type & | get_token () const noexcept |
const json_traits::string_type & | get_header () const noexcept |
const json_traits::string_type & | get_payload () const noexcept |
const json_traits::string_type & | get_signature () const noexcept |
const json_traits::string_type & | get_header_base64 () const noexcept |
const json_traits::string_type & | get_payload_base64 () const noexcept |
const json_traits::string_type & | get_signature_base64 () const noexcept |
json_traits::object_type | get_payload_json () const |
json_traits::object_type | get_header_json () const |
basic_claim_t | get_payload_claim (const typename json_traits::string_type &name) const |
basic_claim_t | get_header_claim (const typename json_traits::string_type &name) const |
![]() | |
bool | has_algorithm () const noexcept |
bool | has_type () const noexcept |
bool | has_content_type () const noexcept |
bool | has_key_id () const noexcept |
json_traits::string_type | get_algorithm () const |
json_traits::string_type | get_type () const |
json_traits::string_type | get_content_type () const |
json_traits::string_type | get_key_id () const |
bool | has_header_claim (const typename json_traits::string_type &name) const noexcept |
basic_claim_t | get_header_claim (const typename json_traits::string_type &name) const |
![]() | |
bool | has_issuer () const noexcept |
bool | has_subject () const noexcept |
bool | has_audience () const noexcept |
bool | has_expires_at () const noexcept |
bool | has_not_before () const noexcept |
bool | has_issued_at () const noexcept |
bool | has_id () const noexcept |
json_traits::string_type | get_issuer () const |
json_traits::string_type | get_subject () const |
basic_claim_t::set_t | get_audience () const |
date | get_expires_at () const |
date | get_not_before () const |
date | get_issued_at () const |
json_traits::string_type | get_id () const |
bool | has_payload_claim (const typename json_traits::string_type &name) const noexcept |
basic_claim_t | get_payload_claim (const typename json_traits::string_type &name) const |
+Protected Attributes | |
+json_traits::string_type | token |
Unmodified token, as passed to constructor. | |
+json_traits::string_type | header |
Header part decoded from base64. | |
+json_traits::string_type | header_base64 |
Unmodified header part in base64. | |
+json_traits::string_type | payload |
Payload part decoded from base64. | |
+json_traits::string_type | payload_base64 |
Unmodified payload part in base64. | |
+json_traits::string_type | signature |
Signature part decoded from base64. | |
+json_traits::string_type | signature_base64 |
Unmodified signature part in base64. | |
![]() | |
+details::map_of_claims< json_traits > | header_claims |
![]() | |
+details::map_of_claims< json_traits > | payload_claims |
Class containing all information about a decoded token
+
+
|
+ +inline | +
Parses a given token.
+token | The token to parse |
std::invalid_argument | Token is not in correct format |
std::runtime_error | Base64 decoding failed or invalid json |
+
|
+ +inline | +
Parses a given token.
+Decode | is callable, taking a string_type and returns a string_type. It should ensure the padding of the input and then base64url decode and return the results. |
token | The token to parse |
decode | The function to decode the token |
std::invalid_argument | Token is not in correct format |
std::runtime_error | Base64 decoding failed or invalid json |
+
|
+ +inlinenoexcept | +
Get header part as json string
+
|
+ +inlinenoexcept | +
Get header part as base64 string
+
|
+ +inline | +
Get a header claim by name
+name | the name of the desired claim |
jwt::error::claim_not_present_exception | if the claim was not present |
+
|
+ +inline | +
Get all header as JSON object
+
|
+ +inlinenoexcept | +
Get payload part as json string
+
|
+ +inlinenoexcept | +
Get payload part as base64 string
+
|
+ +inline | +
Get a payload claim by name
+name | the name of the desired claim |
jwt::error::claim_not_present_exception | if the claim was not present |
+
|
+ +inline | +
Get all payload as JSON object
+
|
+ +inlinenoexcept | +
Get signature part as json string
+
|
+ +inlinenoexcept | +
Get signature part as base64 string
+
|
+ +inlinenoexcept | +
Get token string, as passed to constructor
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::header< json_traits >, including all inherited members.
+basic_claim_t typedef (defined in jwt::header< json_traits >) | jwt::header< json_traits > | |
get_algorithm() const | jwt::header< json_traits > | inline |
get_content_type() const | jwt::header< json_traits > | inline |
get_header_claim(const typename json_traits::string_type &name) const | jwt::header< json_traits > | inline |
get_key_id() const | jwt::header< json_traits > | inline |
get_type() const | jwt::header< json_traits > | inline |
has_algorithm() const noexcept | jwt::header< json_traits > | inline |
has_content_type() const noexcept | jwt::header< json_traits > | inline |
has_header_claim(const typename json_traits::string_type &name) const noexcept | jwt::header< json_traits > | inline |
has_key_id() const noexcept | jwt::header< json_traits > | inline |
has_type() const noexcept | jwt::header< json_traits > | inline |
header_claims (defined in jwt::header< json_traits >) | jwt::header< json_traits > | protected |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
#include <jwt.h>
+Public Types | |
+using | basic_claim_t = basic_claim<json_traits> |
+Public Member Functions | |
bool | has_algorithm () const noexcept |
bool | has_type () const noexcept |
bool | has_content_type () const noexcept |
bool | has_key_id () const noexcept |
json_traits::string_type | get_algorithm () const |
json_traits::string_type | get_type () const |
json_traits::string_type | get_content_type () const |
json_traits::string_type | get_key_id () const |
bool | has_header_claim (const typename json_traits::string_type &name) const noexcept |
basic_claim_t | get_header_claim (const typename json_traits::string_type &name) const |
+Protected Attributes | |
+details::map_of_claims< json_traits > | header_claims |
Base class that represents a token header. Contains Convenience accessors for common claims.
+
+
|
+ +inline | +
Get algorithm claim
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) |
+
|
+ +inline | +
Get content type claim
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) |
+
|
+ +inline | +
Get header claim
std::runtime_error | If claim was not present |
+
|
+ +inline | +
Get key id claim
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) |
+
|
+ +inline | +
Get type claim
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) |
+
|
+ +inlinenoexcept | +
Check if algorithm is present ("alg")
+
|
+ +inlinenoexcept | +
Check if content type is present ("cty")
+
|
+ +inlinenoexcept | +
Check if a header claim is present
+
|
+ +inlinenoexcept | +
Check if key id is present ("kid")
+
|
+ +inlinenoexcept | +
Check if type is present ("typ")
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::helper::evp_pkey_handle, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
Handle class for EVP_PKEY structures. + More...
+ +#include <jwt.h>
+Public Member Functions | |
+constexpr | evp_pkey_handle () noexcept=default |
Creates a null key pointer. | |
constexpr | evp_pkey_handle (EVP_PKEY *key) noexcept |
Construct a new handle. The handle takes ownership of the key. | |
+ | evp_pkey_handle (const evp_pkey_handle &other) |
+ | evp_pkey_handle (evp_pkey_handle &&other) noexcept |
+evp_pkey_handle & | operator= (const evp_pkey_handle &other) |
+evp_pkey_handle & | operator= (evp_pkey_handle &&other) noexcept |
+evp_pkey_handle & | operator= (EVP_PKEY *key) |
+EVP_PKEY * | get () const noexcept |
+bool | operator! () const noexcept |
+ | operator bool () const noexcept |
Handle class for EVP_PKEY structures.
+Starting from OpenSSL 1.1.0, EVP_PKEY has internal reference counting. This handle class allows jwt-cpp to leverage that and thus safe an allocation for the control block in std::shared_ptr. The handle uses shared_ptr as a fallback on older versions. The behaviour should be identical between both.
+
+
|
+ +inlineexplicitconstexprnoexcept | +
Construct a new handle. The handle takes ownership of the key.
+key | The key to store |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::jwk< json_traits >, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
JSON Web Key. + More...
+ +#include <jwt.h>
+Public Member Functions | |
+JWT_CLAIM_EXPLICIT | jwk (const typename json_traits::string_type &str) |
+JWT_CLAIM_EXPLICIT | jwk (const typename json_traits::value_type &json) |
json_traits::string_type | get_key_type () const |
json_traits::string_type | get_use () const |
basic_claim_t::set_t | get_key_operations () const |
json_traits::string_type | get_algorithm () const |
json_traits::string_type | get_key_id () const |
json_traits::string_type | get_curve () const |
Get curve claim. | |
json_traits::array_type | get_x5c () const |
json_traits::string_type | get_x5u () const |
json_traits::string_type | get_x5t () const |
json_traits::string_type | get_x5t_sha256 () const |
json_traits::string_type | get_x5c_key_value () const |
bool | has_key_type () const noexcept |
bool | has_use () const noexcept |
bool | has_key_operations () const noexcept |
bool | has_algorithm () const noexcept |
bool | has_curve () const noexcept |
bool | has_key_id () const noexcept |
bool | has_x5u () const noexcept |
bool | has_x5c () const noexcept |
bool | has_x5t () const noexcept |
bool | has_x5t_sha256 () const noexcept |
bool | has_jwk_claim (const typename json_traits::string_type &name) const noexcept |
basic_claim_t | get_jwk_claim (const typename json_traits::string_type &name) const |
bool | empty () const noexcept |
json_traits::object_type | get_claims () const |
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.
+
+
|
+ +inlinenoexcept | +
Check if the jwk has any claims
+
|
+ +inline | +
Get algorithm claim
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) |
+
|
+ +inline | +
Get all jwk claims
+
|
+ +inline | +
Get curve claim.
+https://www.rfc-editor.org/rfc/rfc7518.html#section-6.2.1.1 https://www.iana.org/assignments/jose/jose.xhtml#table-web-key-elliptic-curve
+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) |
+
|
+ +inline | +
Get jwk claim by name
std::runtime_error | If claim was not present |
+
|
+ +inline | +
Get key id claim
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) |
+
|
+ +inline | +
Get key operation types claim
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) |
+
|
+ +inline | +
Get key type claim
+This returns the general type (e.g. RSA or EC), not a specific algorithm value.
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) |
+
|
+ +inline | +
Get public key usage claim
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) |
+
|
+ +inline | +
Get x5c claim
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) |
+
|
+ +inline | +
Get x5c claim as a string
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) |
+
|
+ +inline | +
Get X509 thumbprint claim
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) |
+
|
+ +inline | +
Get X509 SHA256 thumbprint claim
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) |
+
|
+ +inline | +
Get X509 URL claim
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) |
+
|
+ +inlinenoexcept | +
Check if algorithm is present ("alg")
+
|
+ +inlinenoexcept | +
Check if curve is present ("crv")
+
|
+ +inlinenoexcept | +
Check if a jwk claim is present
+
|
+ +inlinenoexcept | +
Check if key id is present ("kid")
+
|
+ +inlinenoexcept | +
Check if a key operations parameter is present ("key_ops")
+
|
+ +inlinenoexcept | +
Check if a key type is present ("kty")
+
|
+ +inlinenoexcept | +
Check if a public key usage indication is present ("use")
+
|
+ +inlinenoexcept | +
Check if X509 Chain is present ("x5c")
+
|
+ +inlinenoexcept | +
Check if a X509 thumbprint is present ("x5t")
+
|
+ +inlinenoexcept | +
Check if a X509 SHA256 thumbprint is present ("x5t#S256")
+
|
+ +inlinenoexcept | +
Check if X509 URL is present ("x5u")
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::jwks< json_traits >, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
JWK Set. + More...
+ +#include <jwt.h>
+Public Types | |
+using | jwks_t = jwk<json_traits> |
JWK instance template specialization. | |
+using | jwks_vector_t = std::vector<jwks_t> |
Type specialization for the vector of JWK. | |
+using | iterator = typename jwks_vector_t::iterator |
+using | const_iterator = typename jwks_vector_t::const_iterator |
+Public Member Functions | |
jwks ()=default | |
JWT_CLAIM_EXPLICIT | jwks (const typename json_traits::string_type &str) |
+iterator | begin () |
+iterator | end () |
+const_iterator | cbegin () const |
+const_iterator | cend () const |
+const_iterator | begin () const |
+const_iterator | end () const |
bool | has_jwk (const typename json_traits::string_type &key_id) const noexcept |
jwks_t | get_jwk (const typename json_traits::string_type &key_id) const |
JWK Set.
+https://tools.ietf.org/html/rfc7517
+A JSON object that represents a set of JWKs. The JSON object MUST have a "keys" member, which is an array of JWKs.
+This container takes a JWKs and simplifies it to a vector of JWKs
+
+
|
+ +default | +
Default constructor producing an empty object without any keys
+ +
+
|
+ +inline | +
Parses a string buffer to extract the JWKS.
str | buffer containing JSON object representing a JWKS |
error::invalid_json_exception | or underlying JSON implation error if the JSON is invalid with regards to the JWKS specification |
+
|
+ +inline | +
Get jwk
std::runtime_error | If jwk was not present |
+
|
+ +inlinenoexcept | +
Check if a jwk with the kid is present
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::payload< json_traits >, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
#include <jwt.h>
+Public Types | |
+using | basic_claim_t = basic_claim<json_traits> |
+Public Member Functions | |
bool | has_issuer () const noexcept |
bool | has_subject () const noexcept |
bool | has_audience () const noexcept |
bool | has_expires_at () const noexcept |
bool | has_not_before () const noexcept |
bool | has_issued_at () const noexcept |
bool | has_id () const noexcept |
json_traits::string_type | get_issuer () const |
json_traits::string_type | get_subject () const |
basic_claim_t::set_t | get_audience () const |
date | get_expires_at () const |
date | get_not_before () const |
date | get_issued_at () const |
json_traits::string_type | get_id () const |
bool | has_payload_claim (const typename json_traits::string_type &name) const noexcept |
basic_claim_t | get_payload_claim (const typename json_traits::string_type &name) const |
+Protected Attributes | |
+details::map_of_claims< json_traits > | payload_claims |
Base class that represents a token payload. Contains Convenience accessors for common claims.
+
+
|
+ +inline | +
Get audience claim
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a set (Should not happen in a valid token) |
+
|
+ +inline | +
Get expires claim
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a date (Should not happen in a valid token) |
+
|
+ +inline | +
Get id claim
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) |
+
|
+ +inline | +
Get issued at claim
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a date (Should not happen in a valid token) |
+
|
+ +inline | +
Get issuer claim
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) |
+
|
+ +inline | +
Get not valid before claim
std::runtime_error | If claim was not present |
std::bad_cast | Claim was present but not a date (Should not happen in a valid token) |
+
|
+ +inline | +
Get payload claim
std::runtime_error | If claim was not present |
+
|
+ +inline | +
Get subject claim
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) |
+
|
+ +inlinenoexcept | +
Check if audience is present ("aud")
+
|
+ +inlinenoexcept | +
Check if expires is present ("exp")
+
|
+ +inlinenoexcept | +
Check if token id is present ("jti")
+
|
+ +inlinenoexcept | +
Check if issued at is present ("iat")
+
|
+ +inlinenoexcept | +
Check if issuer is present ("iss")
+
|
+ +inlinenoexcept | +
Check if not before is present ("nbf")
+
|
+ +inlinenoexcept | +
Check if a payload claim is present
+
|
+ +inlinenoexcept | +
Check if subject is present ("sub")
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::traits::open_source_parsers_jsoncpp::array_type, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+Public Types | |
+using | value_type = Json::Value |
+Public Member Functions | |
+ | array_type (const array_type &)=default |
+ | array_type (const Json::Value &o) |
+ | array_type (array_type &&)=default |
+ | array_type (Json::Value &&o) |
+template<typename Iterator > | |
array_type (Iterator begin, Iterator end) | |
+array_type & | operator= (const array_type &o)=default |
+array_type & | operator= (array_type &&o) noexcept=default |
+value_type const & | front () const |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::traits::open_source_parsers_jsoncpp::object_type, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+Public Types | |
+using | key_type = std::string |
+using | mapped_type = Json::Value |
+using | size_type = size_t |
+Public Member Functions | |
+ | object_type (const object_type &)=default |
+ | object_type (const Json::Value &o) |
+ | object_type (object_type &&)=default |
+ | object_type (Json::Value &&o) |
+object_type & | operator= (const object_type &o)=default |
+object_type & | operator= (object_type &&o) noexcept=default |
+const mapped_type & | at (const key_type &key) const |
+size_type | count (const key_type &key) const |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
This is the complete list of members for jwt::verifier< Clock, json_traits >, including all inherited members.
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
#include <jwt.h>
+Public Types | |
+using | basic_claim_t = basic_claim<json_traits> |
using | verify_check_fn_t |
Verification function data structure. | |
+Public Member Functions | |
verifier (Clock c) | |
verifier & | leeway (size_t leeway) |
verifier & | expires_at_leeway (size_t leeway) |
verifier & | not_before_leeway (size_t leeway) |
verifier & | issued_at_leeway (size_t leeway) |
verifier & | with_type (const typename json_traits::string_type &type, std::locale locale=std::locale{}) |
verifier & | with_issuer (const typename json_traits::string_type &iss) |
verifier & | with_subject (const typename json_traits::string_type &sub) |
verifier & | with_audience (const typename basic_claim_t::set_t &aud) |
verifier & | with_audience (const typename json_traits::string_type &aud) |
verifier & | with_id (const typename json_traits::string_type &id) |
verifier & | with_claim (const typename json_traits::string_type &name, verify_check_fn_t fn) |
verifier & | with_claim (const typename json_traits::string_type &name, basic_claim_t c) |
template<typename Algorithm > | |
verifier & | allow_algorithm (Algorithm alg) |
Add an algorithm available for checking. | |
void | verify (const decoded_jwt< json_traits > &jwt) const |
void | verify (const decoded_jwt< json_traits > &jwt, std::error_code &ec) const |
Verifier class used to check if a decoded token contains all claims required by your application and has a valid signature.
+using jwt::verifier< Clock, json_traits >::verify_check_fn_t | +
Verification function data structure.
+This gets passed the current verifier, a reference to the decoded jwt, a reference to the key of this claim, as well as a reference to an error_code. The function checks if the actual value matches certain rules (e.g. equality to value x) and sets the error_code if it does not. Once a non zero error_code is encountered the verification stops and this error_code becomes the result returned from verify
+ +
+
|
+ +inlineexplicit | +
Constructor for building a new verifier instance
c | Clock instance |
+
|
+ +inline | +
Add an algorithm available for checking.
+This is used to handle incomming tokens for predefined algorithms which the authorization server is provided. For example a small system where only a single RSA key-pair is used to sign tokens
+Algorithm | any algorithm such as those provided by jwt::algorithm |
alg | Algorithm to allow |
+
|
+ +inline | +
Set leeway for expires at. If not specified the default leeway will be used.
leeway | Set leeway to use for expires at. |
+
|
+ +inline | +
Set leeway for issued at. If not specified the default leeway will be used.
leeway | Set leeway to use for issued at. |
+
|
+ +inline | +
Set default leeway to use.
leeway | Default leeway to use if not specified otherwise |
+
|
+ +inline | +
Set leeway for not before. If not specified the default leeway will be used.
leeway | Set leeway to use for not before. |
+
|
+ +inline | +
Verify the given token.
jwt | Token to check |
token_verification_exception | Verification failed |
+
|
+ +inline | +
Verify the given token.
jwt | Token to check |
ec | error_code filled with details on error |
+
|
+ +inline | +
Set an audience to check for. If any of the specified audiences is not present in the token the check fails.
aud | Audience to check for. |
+
|
+ +inline | +
Set an audience to check for. If the specified audiences is not present in the token the check fails.
aud | Audience to check for. |
+
|
+ +inline | +
Specify a claim to check for equality (both type & value). See the private-claims.cpp example.
+name | Name of the claim to check for |
c | Claim to check for |
+
|
+ +inline | +
Specify a claim to check for using the specified operation. This is helpful for implementating application specific authentication checks such as the one seen in partial-claim-verifier.cpp
+name | Name of the claim to check for |
fn | Function to use for verifying the claim |
+
|
+ +inline | +
Set an id to check for. Check is case sensitive.
id | ID to check for. |
+
|
+ +inline | +
Set an issuer to check for. Check is case sensitive.
iss | Issuer to check for. |
+
|
+ +inline | +
Set a subject to check for. Check is case sensitive.
sub | Subject to check for. |
+
|
+ +inline | +
Set an type to check for.
+According to RFC 7519 Section 5.1, This parameter is ignored by JWT implementations; any processing of this parameter is performed by the JWT application. Check is case sensitive.
+type | Type Header Parameter to check for. |
locale | Localization functionality to use when comparing |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+Directories | |
boost-json | |
danielaparker-jsoncons | |
kazuho-picojson | |
nlohmann-json | |
open-source-parsers-jsoncpp | |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+Directories | |
traits | |
+Files | |
es256k.cpp | |
jwks-verify.cpp | |
partial-claim-verifier.cpp | |
print-claims.cpp | |
private-claims.cpp | |
rsa-create.cpp | |
rsa-verify.cpp | |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+
+Directories | |
jwt-cpp | |
+ JWT-CPP v0.7.1
+
+ A header only library for creating and validating JSON Web Tokens (JWT) in C++
+ |
+