Public api

The public api of the library can be found in include/licensecc/licensecc.h that is the only file you should include when you want to use the library.

Verify a license

LCC_EVENT_TYPE license::LicenseFacade::acquire_license(const CallerInformations *callerInformation, const LicenseLocation *licenseLocation, LicenseInfo *license_out) noexcept

Acquire a license for the specified product.

This method coordinates the license acquisition process by:

  1. Reading licenses from various locations

  2. Verifying signatures and limits

  3. Selecting the best valid license

Parameters:
  • callerInformation – Optional caller information

  • licenseLocation – Optional license location hint

  • license_out – Optional output for license information

Returns:

LCC_EVENT_TYPE indicating success or failure

struct CallerInformations

Informations about the software requesting the license verification (eg, software version, feature to verify).

Public Members

char version[LCC_API_VERSION_LENGTH + 1]

software version in format xxxx[.xxxx.xxxx] NOT IMPLEMENTED pass ‘\0’

char feature_name[LCC_API_FEATURE_NAME_SIZE + 1]

Name of the feature you want to verify. If empty (‘\0’) the ‘default’ feature will be verified. (every project has a default feature that is equal to the project name). Every feature has a separate section in the license file:

unsigned int magic

this number passed in by the application must correspond to the magic number used when compiling the library. See cmake parameter -DLCC_PROJECT_MAGIC_NUM and licensecc_properties.h macro VERIFY_MAGIC

struct LicenseLocation

This structure contains informations on the raw license data. Software authors can specify the location of the license file or its full content.

Can be NULL, in this case OpenLicenseManager will try to figure out the license file location on its own.

struct LicenseInfo

Public Members

AuditEvent status[LCC_API_AUDIT_EVENT_NUM]

Detailed reason of success/failure. Reasons for a failure can be multiple (for instance, license expired and signature not verified). Only the last AUDIT_EVENT_NUM are reported.

char expiry_date[LCC_API_EXPIRY_DATE_SIZE + 1]

Eventual expiration date of the software, can be ‘\0’ if the software don’t expire