Offline Activation

Offline activation ensures that software products can be activated and remain functional without an online connection. This approach is crucial for organizations needing to manage licenses in the environment.

For more details, please refer to the Offline Activation Tokens Library Documentation.

Important - Source of Keys and Tokens

  • Encryption Key: The AES encryption key is generated by the application and stored in persistent storage. The same key should be used during the generation of the activation request and parsing of the activation response

// encryption key example: vP3YI46HziBgPfWBqcSqHqzL0uQD8fB+nBc6pSP0C3Q=
  • Token: Comes from the server/End User Portal

  • Account Key: The tenant key from the account settings

Token Functions Documentation

Generate an activation request token from the provided data

bool generateActivationRequestToken(char *token, int *tokenLength, const char *data, const char* encryptionKey, const char* accountKey);

Parameters

  • token (char*): Buffer to store the generated token

  • tokenLength (int*): Length of the generated token

  • data (const char*): Data to be included in the token

  • encryptionKey (const char*): AES key to encrypt the token, the same key that was used during the generation of the activation request, should be used

  • accountKey (const char*): Key to sign the token

Return Value

  • true If the token is successfully generated

  • false If there is an error when generating the token

Example

char token[1024];
int tokenLen;
const char* data = "example_data";
const char* encryptionKey = "example_encryption_key";
const char* accountKey = "example_account_key";

bool success = generateActivationRequestToken(token, &tokenLen, data, encryptionKey, accountKey);
if (success) {
    // Use the generated token
} else {
    // Handle the error
}

Parse an activation response token to extract its payload data

bool parseActivationResponseToken(char* data, int* payloadLength, const char* token, const char* encryptionKey, const char* accountKey);

Parameters

  • data (char*): Buffer to store the extracted payload

  • payloadLength (int*): Length of the extracted payload

  • token (const char*): Activation response token

  • encryptionKey (const char*): AES key to decrypt the token

  • accountKey (const char*): Key to validate the token

Return Value

  • true If the token is successfully parsed

  • false If there is an error when parsing the token

Example

char payload[1024];
int payloadLen;
const char* token = "example_token";
const char* encryptionKey = "example_encryption_key";
const char* accountKey = "example_account_key";

bool success = parseActivationResponseToken(payload, &payloadLen, token, encryptionKey, accountKey);
if (success) {
    // Process the extracted payload
} else {
    // Handle the error
}

Last updated

Zentitle2

Service terms

© Copyright - Nalpeiron, all rights reserved Website use subject to Terms and Conditions. See our Privacy Policy Use of Zentitle is subject to our Service Terms and Conditions