Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::LicenseGenerator Class Reference

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.

Detailed Description

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).

Constructor & Destructor Documentation

◆ LicenseGenerator()

pulp::runtime::LicenseGenerator::LicenseGenerator ( )
default

Member Function Documentation

◆ generate()

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.

◆ generate_v1()

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.

◆ generate_v2()

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.

◆ set_private_key()

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.

◆ set_shared_secret()

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().


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/runtime/include/pulp/runtime/license.hpp