10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
DefaultLicenseTokens.h
1#ifndef TENDUKE_EE_LICENSING_IMPL_DEFAULTLEASESTORE_H
2#define TENDUKE_EE_LICENSING_IMPL_DEFAULTLEASESTORE_H
3
4#include "../LicenseTokens.h"
5#include "crypto/PublicKey.h"
6#include "crypto/KeyFactory.h"
7#include "json/JSONParser.h"
8#include "jwt/JWTParserFactory.h"
9
10#include <memory>
11
12
13namespace tenduke { namespace ee { namespace licensing { namespace impl {
14
19{
20public:
29 const std::shared_ptr<const tenduke::jwt::JWTParserFactory> &newJwtParser,
30 const std::shared_ptr<const tenduke::crypto::KeyFactory> &newKey,
31 const std::shared_ptr<const tenduke::json::JSONParser> &parseJson,
32 const std::shared_ptr<const tenduke::crypto::PublicKey> &tokenVerificationKey
33 );
34
35 // `tenduke::ee::licensing::LicenseTokens` implementation
36public:
37 std::string serialize(const std::vector<tenduke::ee::licensing::Lease> &leases) const override;
38 std::string serialize(const std::map<std::string, tenduke::ee::licensing::Lease> &leases) const override;
39 std::vector<tenduke::ee::licensing::Lease> deserialize(const std::string &serializedLeases) const override;
40
41private:
42 const std::shared_ptr<const tenduke::jwt::JWTParserFactory> newJWTParser;
43 const std::shared_ptr<const tenduke::crypto::KeyFactory> newKey;
44 const std::shared_ptr<const tenduke::json::JSONParser> parseJSON;
45 const std::shared_ptr<const tenduke::crypto::PublicKey> tokenVerificationKey;
46};
47
48}}}}
49
50#endif //TENDUKE_EE_LICENSING_IMPL_DEFAULTLEASESTORE_H
Service for managing licenses tokens.
Definition LicenseTokens.h:18
Default implementation of tenduke::ee::licensing::LicenseTokens.
Definition DefaultLicenseTokens.h:19
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:20
std::string serialize(const std::vector< tenduke::ee::licensing::Lease > &leases) const override
Serializes given leases to a JSON-string.
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4