|
10Duke Enterprise C++ SDK
|
#include <JWK.h>
Describes a JWK, Json Web Key.
IMPLEMENTATION NOTE: This currently only supports tenduke::crypto:PublicKey's. IMPLEMENTATION NOTE: Only subset of attributes / key types are supported.
Public Member Functions | |
| JWK (std::string id, std::string type, const std::shared_ptr< const tenduke::crypto::PublicKey > &key, std::string use="", std::string alg="") | |
| Constructs new instance. | |
| bool | isUsableForSignature (::tenduke::crypto::HashAlgorithm algorithm) const |
| Checks if the key can be used to verify signatures made with given algorithm: The key must not be meant for other use than signatures (use), and if the key specifies an algorithm (alg), it must match. | |
Static Public Member Functions | |
| ::tenduke::crypto::HashAlgorithm | mapFromJWTAlgorithm (const std::string &jwtAlgorithm) |
| Maps JSON Web Token algorithm (alg) to Algorithm. | |
Public Attributes | |
| const std::string | id |
| Id of the key, JWK property "kid". | |
| const std::string | type |
| Type of the key, JWK property "kty". | |
| const std::shared_ptr< const tenduke::crypto::PublicKey > | key |
| Parsed key representation. | |
| const std::string | use |
| Intended use of the key, JWK property "use". | |
| const std::string | alg |
| Algorithm intended for use with the key, JWK property "alg". | |
| tenduke::jwk::JWK::JWK | ( | std::string | id, |
| std::string | type, | ||
| const std::shared_ptr< const tenduke::crypto::PublicKey > & | key, | ||
| std::string | use = "", | ||
| std::string | alg = "" ) |
Constructs new instance.
| id | id of the JWK (kid property) |
| type | type of the JWK (kty property, but this is not enough to describe all keys) |
| key | the actual crypto graphic key |
| use | intended use of the key (use property, e.g. sig or enc). Empty if not specified. |
| alg | algorithm intended for use with the key (alg property, e.g. RS256). Empty if not specified. |
| bool tenduke::jwk::JWK::isUsableForSignature | ( | ::tenduke::crypto::HashAlgorithm | algorithm | ) | const |
|
static |
Maps JSON Web Token algorithm (alg) to Algorithm.
TODO: Is this in correct place?
| jwtAlgorithm | - |
| const std::string tenduke::jwk::JWK::alg |
Algorithm intended for use with the key, JWK property "alg".
Empty if not specified.
| const std::string tenduke::jwk::JWK::use |
Intended use of the key, JWK property "use".
Empty if not specified.