10Duke Enterprise C++ Client
|
#include <LicenseTokens.h>
Service for managing licenses tokens.
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::Lease > | deserialize (const std::string &serializedLeases) const =0 |
De-serializes given JSON string into leases. | |
|
pure virtual |
De-serializes given JSON string into leases.
serializedLeases | - |
Implemented in tenduke::ee::licensing::impl::DefaultLicenseTokens.
|
pure virtual |
Serializes given leases in map to a JSON-string.
leases | a map of leases, where key is the licensed item name and value is the lease |
Implemented in tenduke::ee::licensing::impl::DefaultLicenseTokens.
|
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.
leases | - |
Implemented in tenduke::ee::licensing::impl::DefaultLicenseTokens.