License key validator — checks v1 RSA-signed or v2 AES-256-GCM keys. More...
#include <license.hpp>
Public Member Functions | |
| LicenseValidator ()=default | |
| void | set_public_key (std::string_view pem) |
| Set the RSA public key (PEM format) for v1 signature verification. | |
| void | set_shared_secret (const uint8_t *secret_32, size_t secret_size) |
| Set the 32-byte symmetric secret used to decrypt v2 license keys. | |
| LicenseStatus | validate (std::string_view license_key) const |
| Validate a license key string. | |
| std::optional< LicenseInfo > | validate_and_parse (std::string_view license_key) const |
| Validate and extract license info. | |
| LicenseStatus | validate_file (std::string_view path) const |
| Validate a license key file. | |
| bool | is_valid_for_machine (const LicenseInfo &info) const |
| Check if a license is valid for this machine. | |
License key validator — checks v1 RSA-signed or v2 AES-256-GCM keys.
The public key (v1) and shared secret (v2) are embedded in the plugin; the matching private key (v1) and shared secret (v2) stay on the server.
|
default |
| bool pulp::runtime::LicenseValidator::is_valid_for_machine | ( | const LicenseInfo & | info | ) | const |
Check if a license is valid for this machine.
| void pulp::runtime::LicenseValidator::set_public_key | ( | std::string_view | pem | ) |
Set the RSA public key (PEM format) for v1 signature verification.
Optional if the plugin no longer ships v1 keys.
| void pulp::runtime::LicenseValidator::set_shared_secret | ( | const uint8_t * | secret_32, |
| size_t | secret_size ) |
Set the 32-byte symmetric secret used to decrypt v2 license keys.
Optional if the plugin still only ships v1 keys.
| LicenseStatus pulp::runtime::LicenseValidator::validate | ( | std::string_view | license_key | ) | const |
Validate a license key string.
Auto-detects v1 vs v2 via detect_license_format() and dispatches to the matching path.
| std::optional< LicenseInfo > pulp::runtime::LicenseValidator::validate_and_parse | ( | std::string_view | license_key | ) | const |
Validate and extract license info.
| LicenseStatus pulp::runtime::LicenseValidator::validate_file | ( | std::string_view | path | ) | const |
Validate a license key file.