1. Go to this page and download the library: Download ente/cryptolens-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ente / cryptolens-php example snippets
ini_set("display_errors", 1);
s;
use Cryptolens_PHP_Client\Key;
$c = new Cryptolens("YOUR_TOKEN", 12345, Cryptolens::CRYPTOLENS_OUTPUT_JSON);
$k = new Key($c);
$key = "XXXXX-XXXXX-XXXXX-XXXXX";
$machine_id = $k->getMachineId();
print_r("Key 'activate':" . var_dump($k->activate($key, $machine_id)));
// OR
$c->key()->activate($key, $c->key()->getMachineId());
ini_set("display_errors", 1);
s;
use Cryptolens_PHP_Client\Key;
$c = new Cryptolens("YOUR_TOKEN", 12345, Cryptolens::CRYPTOLENS_OUTPUT_PHP);
$k = new Key($c);
# generate new key and activate Feature 3 for it
$key = $k->create_key(["F3" => true])["key"];
$license_data = json_decode($k->get_key($key), true);
if($license_data["F3"]){
echo "Feature 3 enabled for license " . $key;
} elseif($license_data["F4"]){
echo "Feature 4 enabled for license " . $key;
}
yptolens_PHP_Client\Cryptolens;
use Cryptolens_PHP_Client\License;
$c = new Cryptolens("YOUR_TOKEN", 12345, Cryptolens::CRYPTOLENS_OUTPUT_PHP);
$l = new License($c); // to specify custom key file location other than /classes/key.pub specify the FULL path as License($c, "/var/www/my/public/key.pub")
$fromString = $l->validateLicense("BASE64-ENCODED-STRING", "BASE64-ENCODED-STRING") // licenseKey and signature
$fromFileContent = $l->validateLicenseFromFileContent(file_get_contents("license.skm")); // License file as string
$fromFile = $l->validateLicenseFromFile("license.skm")
if($fromFile){
echo "Signature successfully validated";
} else {
echo "Could not verify signature";
}
yptolens_PHP_Client\Cryptolens;
...
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.