Validate Key

Validates a license key with the server and creates an authenticated session.

This function must be called after SendHeartbeat() to ensure secure connection is established.

Signature

bool ValidateKey(const std::string& licenseKey);

Parameters

Type: std::string

Description: The license key to validate

Format: "XXXX-XXXX-XXXX-XXXX"

Required: Yes

Returns

Type: bool

Value
Description

true

License is valid and session created

false

License is invalid or validation failed

Basic Example

Error Handling

How It Works

The server performs the following checks:

1

License exists

Verify the license key exists in the database.

2

License active

Ensure the license is active (not suspended or expired).

3

HWID check

Confirm HWID matches (if license is bound to hardware).

4

Device limit

Ensure device limit not exceeded.

5

Product access

Verify product access permissions.

If validation succeeds, a session token is generated and stored internally.

  • GetSessionToken - Retrieve session token

  • GetKeyInfo - Get license details

  • SendHeartbeat - Required before validation

Last updated