10Duke Scale C++ Client
Loading...
Searching...
No Matches
JWKS.h
1#ifndef TENDUKE_JWK_JWKS_H
2#define TENDUKE_JWK_JWKS_H
3
4#include "./JWK.h"
5
6#include <map>
7#include <mutex>
8#include <string>
9
10namespace tenduke { namespace jwk {
11
16class JWKS
17{
18public:
24 void addKey(const tenduke::jwk::JWK &key);
25
30 bool empty();
31
36 std::map<std::string, tenduke::jwk::JWK> getAllKeys();
37
44 tenduke::jwk::JWK getKey(const std::string &keyId);
45
51 bool hasKey(const std::string &keyId);
52
58 void merge(const JWKS &other);
59
64 void remove(const std::string &keyId);
65
66private:
67 std::map<std::string, tenduke::jwk::JWK> keys;
68 std::recursive_timed_mutex serializeStateAccess;
69};
70
71}}
72
73#endif //TENDUKE_JWK_JWKS_H
JSON Web Key Set, a container for one or more tenduke::jwk::JWKs, indexed by the JWK key ID.
Definition JWKS.h:17
bool hasKey(const std::string &keyId)
Checks if the set has a key with the given id.
Definition JWKS.cpp:33
void addKey(const tenduke::jwk::JWK &key)
Adds new key to the set.
Definition JWKS.cpp:5
std::map< std::string, tenduke::jwk::JWK > getAllKeys()
Returns all contained JWKs as a map.
Definition JWKS.cpp:19
void merge(const JWKS &other)
Merges another JWKS to this key set.
Definition JWKS.cpp:40
bool empty()
Checks if the key set is empty.
Definition JWKS.cpp:12
void remove(const std::string &keyId)
Removes key by ID.
Definition JWKS.cpp:50
tenduke::jwk::JWK getKey(const std::string &keyId)
Returns JWK by its id.
Definition JWKS.cpp:26
Describes a JWK, Json Web Key.
Definition JWK.h:17
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7