10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
tenduke::ee::licensing::LicenseTokens Class Referenceabstract

#include <LicenseTokens.h>

Detailed Description

Service for managing licenses tokens.

Inheritance diagram for tenduke::ee::licensing::LicenseTokens:
tenduke::ee::licensing::impl::DefaultLicenseTokens

Public Member Functions

virtual std::string serialize (const std::vector< tenduke::ee::licensing::Lease > &leases) const =0
 Serializes given leases to a JSON-string.
 
virtual std::string serialize (const std::map< std::string, tenduke::ee::licensing::Lease > &leases) const =0
 Serializes given leases in map to a JSON-string.
 
virtual std::vector< tenduke::ee::licensing::Leasedeserialize (const std::string &serializedLeases) const =0
 De-serializes given JSON string into leases.
 

Member Function Documentation

◆ deserialize()

virtual std::vector< tenduke::ee::licensing::Lease > tenduke::ee::licensing::LicenseTokens::deserialize ( const std::string &  serializedLeases) const
pure virtual

De-serializes given JSON string into leases.

Parameters
serializedLeases-
Returns
-

Implemented in tenduke::ee::licensing::impl::DefaultLicenseTokens.

◆ serialize() [1/2]

virtual std::string tenduke::ee::licensing::LicenseTokens::serialize ( const std::map< std::string, tenduke::ee::licensing::Lease > &  leases) const
pure virtual

Serializes given leases in map to a JSON-string.

Parameters
leasesa map of leases, where key is the licensed item name and value is the lease
Returns
-

Implemented in tenduke::ee::licensing::impl::DefaultLicenseTokens.

◆ serialize() [2/2]

virtual std::string tenduke::ee::licensing::LicenseTokens::serialize ( const std::vector< tenduke::ee::licensing::Lease > &  leases) const
pure virtual

Serializes given leases to a JSON-string.

This JSON can then be persisted to disk and re-loaded when the application is restarted. The JSON can then be deserialized with the LicenseTokens::deserialize(const std::string &) const-method.

One use for the serialized leases is to use the leases even when there is no network connection.

NOTE: We strongly recommend encrypting the JSON before storing it to disk. This prevents tampering the the data. The serialized JSON contains the validation key, this is because then the tokens can be validated off-line, without e.g. having to load the validation key from the network.

NOTE: The format is not documented. You may read the JSON, but do not generate the JSON manually or modify the generated JSON.

Parameters
leases-
Returns
-

Implemented in tenduke::ee::licensing::impl::DefaultLicenseTokens.


The documentation for this class was generated from the following file: