10Duke Scale C++ Client
Loading...
Searching...
No Matches
JWKParser.h
1#ifndef TENDUKE_JWK_JWKPARSER_H
2#define TENDUKE_JWK_JWKPARSER_H
3
4#include "./JWK.h"
5#include "crypto/PublicKey.h"
6#include "crypto/KeyFactory.h"
7#include "json/JSONObject.h"
8#include "utl/Base64Decoder.h"
9
10#include <vector>
11#include <memory>
12#include <string>
13
14namespace tenduke { namespace jwk {
15
23{
24public:
31 std::shared_ptr<const tenduke::utl::Base64Decoder> base64Decoder,
32 std::shared_ptr<const tenduke::crypto::KeyFactory> keyFactory
33 );
34 virtual ~JWKParser() = default;
35
45 virtual JWK from(const json::JSONObject &key) const;
46
47protected:
57 virtual std::unique_ptr<const tenduke::crypto::PublicKey> toPublicKey(const json::JSONObject &key) const;
58
59private:
60 std::shared_ptr<const tenduke::utl::Base64Decoder> base64;
61 std::shared_ptr<const tenduke::crypto::KeyFactory> createKey;
62};
63
64}}
65
66#endif // TENDUKE_JWK_JWKPARSER_H
JSON object element.
Definition JSONObject.h:16
Parses JSON Web Key (JWK) from JSON.
Definition JWKParser.h:23
virtual std::unique_ptr< const tenduke::crypto::PublicKey > toPublicKey(const json::JSONObject &key) const
Converts given JWKS in JSONObject to a PublicKey.
Definition JWKParser.cpp:36
virtual JWK from(const json::JSONObject &key) const
Parses single JWK from tenduke::json::JSOObject.
Definition JWKParser.cpp:23
Describes a JWK, Json Web Key.
Definition JWK.h:17
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7