You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,10 @@
1
1
# Changelog
2
2
3
+
## v1.0
4
+
5
+
* added support to Data endpoints `addDataObject`, `listDataObject`, `incrementIntValue`, `decrementIntValue`, `setStringValue`, `setIntValue`, `removeDataObject`, `uploadValues`
6
+
* added support for License file validation `License.cryptolens.php`: `verifyLicenseKey`, `verifyLicenseFromFileContent`. See `README.md` for configuration
7
+
3
8
## v0.9
4
9
5
10
* added error handler class `Errors.cryptolens.php` which will now return you the respectful errors and logs them into files.
Copy file name to clipboardExpand all lines: README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,37 @@ In a real values for you can be obtained as follows:
63
63
* You can generate a machine ID for the PHP instance with the builtin `Key::getMachineId()` funtion. Please read the function's documentation for more understanding of the calculation of the machine ID.
64
64
* In an upcoming release this library should be able to also validate license files
65
65
66
+
### Offline license validation
67
+
68
+
The API also allows you to validate license files via the `License.cryptolens.php` file.
69
+
To properly configure this function, please convert the XML-styled public key into PEM format (PKC#1) and save it into the `classes/*` directory as `key.pub` (if `License(<Cryptolens $cryptolens>, <string $pathToKey>)` $pathToKey is set, the path is overwritten by specified one).
70
+
71
+
You can convert your key on a site like this one [here](https://the-x.cn/en-US/certificate/XmlToPem.aspx) or [using this repository](https://github.com/MisterDaneel/PemToXml)
72
+
73
+
You can then validate a license key like this:
74
+
75
+
```php
76
+
<?php
77
+
78
+
require_once "/path/to/autoloader.php";
79
+
use Cryptolens_PHP_Client\Cryptolens;
80
+
use Cryptolens_PHP_Client\License;
81
+
82
+
$c = new Cryptolens("YOUR_TOKEN", 12345, Cryptolens::CRYPTOLENS_OUTPUT_PHP);
83
+
$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")
84
+
85
+
$fromString = $l->validateLicense("BASE64-ENCODED-STRING", "BASE64-ENCODED-STRING") // licenseKey and signature
86
+
$fromFileContent = $l->validateLicenseFromFileContent(file_get_contents("license.skm")); // License file as string
* `listDataObjects()` - Returns all data objects associated with a key, product or account
51
+
* @param int $referencerType Where to assign the data object: license key (2), product (1) or User (0), default = 0
52
+
* @param string $referencerId ID of the referencer, e.g. the license key or product ID. Not required if "User" (0) is referencerType
53
+
* @param string $contains A string, if set only returns Data object where "name" == $contains, default = ""
54
+
* @param bool $showAll If set to `true` if returns both license key, product and account specific data objects all at once. Within response it contains the referencerType and Id.
0 commit comments