|
10Duke Enterprise C++ SDK
|
Public Member Functions | |
| DefaultOfflineLicenseTokenParser (const std::shared_ptr< const ::tenduke::jwt::JWTParser > &jwtParser) | |
| ::tenduke::ee::licensing::Lease | from (const std::string &licenseToken, const std::string &licensedItemName) const override |
| Parses a single token of the given licensed item from given string. | |
| ::tenduke::ee::licensing::Lease | from (const std::string &licenseToken) const override |
| Parses a single token from given string, guessing the licensed item name. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from tenduke::ee::licensing::OfflineLicenseTokenParser | |
| static std::unique_ptr< OfflineLicenseTokenParser > | create (const std::string &validationKeyPEM) |
|
overridevirtual |
Parses a single token from given string, guessing the licensed item name.
The licensed item name is guessed: it is the only claim with value true, which is not a well-known claim. Prefer from(licenseToken, licensedItemName) for licensing decisions, and always check the name of the returned lease.
| licenseToken | the license token |
| tenduke::ee::licensing::InvalidLicenseToken | if the string is not a license token, e.g. there is no claim or several claims, which could be the licensed item name |
| tenduke::jwt::JWTParsingException | if the license token is not a proper JWT |
Implements tenduke::ee::licensing::OfflineLicenseTokenParser.
|
overridevirtual |
Parses a single token of the given licensed item from given string.
Use this for licensing decisions. The license token carries the licensed item name only as a claim "<licensed item name>": true, and the backend signs also other tokens, e.g. ID-tokens, with the same key. The token is accepted only if it has the claim for the given licensed item, with the exact same name.
| licenseToken | the license token |
| licensedItemName | name of the licensed item, which the license token must be for |
| tenduke::ee::licensing::InvalidLicenseToken | if the string is not a license token of the licensed item |
| tenduke::jwt::JWTParsingException | if the license token is not a proper JWT |
Implements tenduke::ee::licensing::OfflineLicenseTokenParser.