1#ifndef TENDUKE_EE_LICENSING_IMPL_DEFAULTLEASESTORE_H
2#define TENDUKE_EE_LICENSING_IMPL_DEFAULTLEASESTORE_H
4#include "../LicenseTokens.h"
5#include "crypto/asymmetric/PublicKey.h"
6#include "crypto/asymmetric/PublicKeyFactory.h"
7#include "crypto/msgauthn/HashAlgorithm.h"
8#include "json/JSONObject.h"
9#include "json/JSONParser.h"
10#include "jwt/JWTParser.h"
11#include "jwt/JWTParserFactory.h"
12#include "jwt/JWTSignatureValidator.h"
48 const std::shared_ptr<const tenduke::jwt::JWTParserFactory> &newJwtParser,
49 const std::shared_ptr<const tenduke::crypto::PublicKeyFactory> &newKey,
50 const std::shared_ptr<const tenduke::json::JSONParser> &parseJson,
51 const std::shared_ptr<const tenduke::jwt::JWTSignatureValidator> &signatureValidator,
57 std::string
serialize(
const std::vector<tenduke::ee::licensing::Lease> &leases)
const override;
58 std::string
serialize(
const std::map<std::string, tenduke::ee::licensing::Lease> &leases)
const override;
59 std::vector<tenduke::ee::licensing::Lease>
deserialize(
const std::string &serializedLeases)
const override;
69 std::vector<std::shared_ptr<const tenduke::crypto::PublicKey>> rememberKeys(
70 const std::vector<std::shared_ptr<const tenduke::crypto::PublicKey>> &keys
74 const std::shared_ptr<const tenduke::jwt::JWTParserFactory> newJWTParser;
75 const std::shared_ptr<const tenduke::crypto::PublicKeyFactory> newKey;
76 const std::shared_ptr<const tenduke::json::JSONParser> parseJSON;
77 const std::shared_ptr<const tenduke::jwt::JWTSignatureValidator> signatureValidator;
78 const ::tenduke::crypto::HashAlgorithm algorithm;
81 mutable std::mutex knownKeysMutex;
83 mutable std::vector<std::shared_ptr<const tenduke::crypto::PublicKey>> knownKeys;
85 mutable std::vector<std::string> knownKeyPEMs;
DefaultLicenseTokens(const std::shared_ptr< const tenduke::jwt::JWTParserFactory > &newJwtParser, const std::shared_ptr< const tenduke::crypto::PublicKeyFactory > &newKey, const std::shared_ptr< const tenduke::json::JSONParser > &parseJson, const std::shared_ptr< const tenduke::jwt::JWTSignatureValidator > &signatureValidator, ::tenduke::crypto::HashAlgorithm algorithm=::tenduke::crypto::HashAlgorithm::SHA256)
Constructs new instance.
Definition DefaultLicenseTokens.cpp:254
Service for managing licenses tokens.
Definition LicenseTokens.h:17
DefaultLicenseTokens(const std::shared_ptr< const tenduke::jwt::JWTParserFactory > &newJwtParser, const std::shared_ptr< const tenduke::crypto::PublicKeyFactory > &newKey, const std::shared_ptr< const tenduke::json::JSONParser > &parseJson, const std::shared_ptr< const tenduke::jwt::JWTSignatureValidator > &signatureValidator, ::tenduke::crypto::HashAlgorithm algorithm=::tenduke::crypto::HashAlgorithm::SHA256)
Constructs new instance.
Definition DefaultLicenseTokens.cpp:254
std::string serialize(const std::map< std::string, tenduke::ee::licensing::Lease > &leases) const override
Serializes given leases in map to a JSON-string.
std::vector< tenduke::ee::licensing::Lease > deserialize(const std::string &serializedLeases) const override
De-serializes given JSON string into leases.
Definition DefaultLicenseTokens.cpp:35
std::string serialize(const std::vector< tenduke::ee::licensing::Lease > &leases) const override
Serializes given leases to a JSON-string.
JSON object element.
Definition JSONObject.h:16
HashAlgorithm
Currently supported hash algorithms.
Definition HashAlgorithm.h:13
Implementations of licensing related services.
Definition DefaultLicenseTokens.h:21
Classes, functions and globals related to 10Duke Enterprise licensing.
Definition AuthzLicensingClient.h:13
Classes, functions and globals of 10Duke Enterprise C++ Client.
Definition APIRequest.h:4
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4