JSON Web Token. More...
Namespaces | |
| algorithm | |
| Various cryptographic algorithms when working with JWT. | |
| alphabet | |
| character maps when encoding and decoding | |
| base | |
| A collection of fellable functions for working with base64 and base64url. | |
| details | |
| error | |
| Everything related to error codes issued by the library. | |
| helper | |
| A collection for working with certificates. | |
| json | |
| JSON Abstractions for working with any library. | |
| traits | |
| verify_ops | |
Classes | |
| class | basic_claim |
| a class to store a generic JSON value as claim More... | |
| class | builder |
| class | decoded_jwt |
| struct | default_clock |
| class | header |
| class | jwk |
| JSON Web Key. More... | |
| class | jwks |
| JWK Set. More... | |
| class | payload |
| class | verifier |
Typedefs | |
| using | date = std::chrono::system_clock::time_point |
| using | claim = basic_claim< traits::boost_json > |
| a class to store a generic Boost.JSON value as claim More... | |
| using | verify_context = verify_ops::verify_context< traits::boost_json > |
Functions | |
| template<typename Clock , typename json_traits > | |
| verifier< Clock, json_traits > | verify (Clock c) |
| template<typename json_traits > | |
| verifier< default_clock, json_traits > | verify (default_clock c={}) |
| template<typename json_traits > | |
| builder< json_traits > | create () |
| template<typename json_traits , typename Decode > | |
| decoded_jwt< json_traits > | decode (const typename json_traits::string_type &token, Decode decode) |
| template<typename json_traits > | |
| decoded_jwt< json_traits > | decode (const typename json_traits::string_type &token) |
| template<typename json_traits > | |
| jwk< json_traits > | parse_jwk (const typename json_traits::string_type &token) |
| template<typename json_traits > | |
| jwks< json_traits > | parse_jwks (const typename json_traits::string_type &token) |
| verifier< default_clock, traits::boost_json > | verify () |
| decoded_jwt< traits::boost_json > | decode (const std::string &token) |
| template<typename Decode > | |
| decoded_jwt< traits::boost_json > | decode (const std::string &token, Decode decode) |
| jwk< traits::boost_json > | parse_jwk (const traits::boost_json::string_type &token) |
| jwks< traits::boost_json > | parse_jwks (const traits::boost_json::string_type &token) |
| template<typename Decode > | |
| decoded_jwt< traits::danielaparker_jsoncons > | decode (const std::string &token, Decode decode) |
| template<typename Decode > | |
| decoded_jwt< traits::kazuho_picojson > | decode (const std::string &token, Decode decode) |
| template<typename Decode > | |
| decoded_jwt< traits::nlohmann_json > | decode (const std::string &token, Decode decode) |
JSON Web Token.
A namespace to contain everything related to handling JSON Web Tokens, JWT for short, as a part of RFC7519, or alternatively for JWS (JSON Web Signature) from RFC7515
| typedef basic_claim< traits::nlohmann_json > jwt::claim |
a class to store a generic Boost.JSON value as claim
a class to store a generic JSON for Modern C++ value as claim
a class to store a generic picojson value as claim
a class to store a generic jsoncons value as claim
This type is the specialization of the basic_claim class which uses the standard template types.
| using jwt::date = typedef std::chrono::system_clock::time_point |
Default system time point in UTC
This type is the specialization of the verify_ops::verify_context class which uses the standard template types.
|
inline |
Return a builder instance to create a new token
|
inline |
Decode a token
| token | Token to decode |
| std::invalid_argument | Token is not in correct format |
| std::runtime_error | Base64 decoding failed or invalid json |
| decoded_jwt<traits::kazuho_picojson> jwt::decode | ( | const std::string & | token, |
| Decode | decode | ||
| ) |
Decode a token
| Decode | is callabled, 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 | Token to decode |
| decode | The token to parse |
| std::invalid_argument | Token is not in correct format |
| std::runtime_error | Base64 decoding failed or invalid json |
| decoded_jwt<traits::nlohmann_json> jwt::decode | ( | const std::string & | token, |
| Decode | decode | ||
| ) |
Decode a token
| Decode | is callabled, 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 | Token to decode |
| decode | The token to parse |
| std::invalid_argument | Token is not in correct format |
| std::runtime_error | Base64 decoding failed or invalid json |
| decoded_jwt<traits::boost_json> jwt::decode | ( | const std::string & | token, |
| Decode | decode | ||
| ) |
Decode a token
| Decode | is callabled, 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 | Token to decode |
| decode | The token to parse |
| std::invalid_argument | Token is not in correct format |
| std::runtime_error | Base64 decoding failed or invalid json |
| decoded_jwt<traits::danielaparker_jsoncons> jwt::decode | ( | const std::string & | token, |
| Decode | decode | ||
| ) |
Decode a token
| Decode | is callabled, 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 | Token to decode |
| decode | The token to parse |
| std::invalid_argument | Token is not in correct format |
| std::runtime_error | Base64 decoding failed or invalid json |
| decoded_jwt<json_traits> jwt::decode | ( | const typename json_traits::string_type & | token | ) |
Decode a token
| token | Token to decode |
| std::invalid_argument | Token is not in correct format |
| std::runtime_error | Base64 decoding failed or invalid json |
| decoded_jwt<json_traits> jwt::decode | ( | const typename json_traits::string_type & | token, |
| Decode | decode | ||
| ) |
Decode a token
| token | Token to decode |
| decode | function that will pad and base64url decode the token |
| std::invalid_argument | Token is not in correct format |
| std::runtime_error | Base64 decoding failed or invalid json |
|
inline |
Parse a jwk
| token | JWK Token to parse |
| std::runtime_error | Token is not in correct format |
| jwk<json_traits> jwt::parse_jwk | ( | const typename json_traits::string_type & | token | ) |
|
inline |
Parse a jwks
| token | JWKs Token to parse |
| std::runtime_error | Token is not in correct format |
| jwks<json_traits> jwt::parse_jwks | ( | const typename json_traits::string_type & | token | ) |
|
inline |
Create a verifier using the default clock
| verifier<Clock, json_traits> jwt::verify | ( | Clock | c | ) |
Create a verifier using the given clock
| c | Clock instance to use |
| verifier<default_clock, json_traits> jwt::verify | ( | default_clock | c = {} | ) |
Create a verifier using the given clock
| c | Clock instance to use |