License key generator (server-side utility). More...
#include <license.hpp>
Public Member Functions | |
| LicenseGenerator ()=default | |
| void | set_private_key (std::string_view pem) |
| Set the RSA private key (PEM format) for signing v1 license keys. | |
| void | set_shared_secret (const uint8_t *secret_32, size_t secret_size) |
| Set the 32-byte symmetric secret for v2 AES-256-GCM license keys. | |
| std::optional< std::string > | generate (const LicenseInfo &info) const |
| Generate a license key string in the current format (kCurrentLicenseFormat). | |
| std::optional< std::string > | generate_v1 (const LicenseInfo &info) const |
| Force v1 (RSA-signed) license output. | |
| std::optional< std::string > | generate_v2 (const LicenseInfo &info) const |
| Force v2 (AES-256-GCM) license output. Used by migrate_v1_to_v2. | |
License key generator (server-side utility).
Uses an RSA private key to sign license data (legacy v1) or a 32-byte symmetric secret (v2 AES-256-GCM).
|
default |
| std::optional< std::string > pulp::runtime::LicenseGenerator::generate | ( | const LicenseInfo & | info | ) | const |
Generate a license key string in the current format (kCurrentLicenseFormat).
Selects between v1 (RSA) and v2 (AES-256-GCM) based on which key has been set.
| std::optional< std::string > pulp::runtime::LicenseGenerator::generate_v1 | ( | const LicenseInfo & | info | ) | const |
Force v1 (RSA-signed) license output.
Used by migration tools that need to emit a legacy key for compatibility testing.
| std::optional< std::string > pulp::runtime::LicenseGenerator::generate_v2 | ( | const LicenseInfo & | info | ) | const |
Force v2 (AES-256-GCM) license output. Used by migrate_v1_to_v2.
| void pulp::runtime::LicenseGenerator::set_private_key | ( | std::string_view | pem | ) |
Set the RSA private key (PEM format) for signing v1 license keys.
Optional — only required if you call generate_v1() directly.
| void pulp::runtime::LicenseGenerator::set_shared_secret | ( | const uint8_t * | secret_32, |
| size_t | secret_size ) |
Set the 32-byte symmetric secret for v2 AES-256-GCM license keys.
This same secret must be embedded in the plugin via LicenseValidator::set_shared_secret().