10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
JWK.h
1#ifndef TENDUKE_JWK_JWK_H
2#define TENDUKE_JWK_JWK_H
3
4#include "../crypto/asymmetric/PublicKey.h"
5#include "../crypto/msgauthn/HashAlgorithm.h"
6
7#include <memory>
8#include <string>
9
10namespace tenduke { namespace jwk {
11
17class JWK {
18public:
27 JWK(
28 std::string id,
29 std::string type,
30 const std::shared_ptr<const tenduke::crypto::PublicKey> &key,
31 std::string use = "",
32 std::string alg = ""
33 );
34
42
44 const std::string id;
46 const std::string type;
48 const std::shared_ptr<const tenduke::crypto::PublicKey> key;
50 const std::string use;
52 const std::string alg;
53
61 static ::tenduke::crypto::HashAlgorithm mapFromJWTAlgorithm(const std::string &jwtAlgorithm);
62};
63
64}}
65
66#endif //TENDUKE_JWK_JWK_H
const std::string use
Intended use of the key, JWK property "use".
Definition JWK.h:50
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 mea...
Definition JWK.cpp:23
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.
Definition JWK.cpp:10
const std::shared_ptr< const tenduke::crypto::PublicKey > key
Parsed key representation.
Definition JWK.h:48
const std::string id
Id of the key, JWK property "kid".
Definition JWK.h:44
const std::string alg
Algorithm intended for use with the key, JWK property "alg".
Definition JWK.h:52
const std::string type
Type of the key, JWK property "kty".
Definition JWK.h:46
::tenduke::crypto::HashAlgorithm mapFromJWTAlgorithm(const std::string &jwtAlgorithm)
Maps JSON Web Token algorithm (alg) to Algorithm.
Definition JWK.cpp:32
HashAlgorithm
Currently supported hash algorithms.
Definition HashAlgorithm.h:13
Support for JSON Web Keys.
Definition DynamicJWKSSignatureValidator.h:13
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4