| KEYZY C++ Client Library 1.7.1 To develop software that is compiled with a C++ compiler and utilizes the KEYZY service (www.keyzy.io)

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Keyzy::KeyzyLicenseManager Class Reference

`#include <KeyzyLicenseManager.h>`

## Public Member Functions
| KeyzyLicenseManager (std::shared_ptr< KeyzyLicenseProvider > licenseProvider)
bool | setSerialNumber (const std::string &serial_number)
bool | setLicenseFile (const std::string &license_file_path)
LicenseStatus | downloadLicenseFile () noexcept
LicenseStatus | downloadLicenseFile (const std::string &serial_number) noexcept
LicenseStatus | upgradeLicense (const std::string &source_serial, const std::string &target_serial) noexcept
bool | setTrialLicense (std::tm dueDate)
| Set trial license.
bool | deleteSerialNumber ()
bool | deleteLicenseFile ()
bool | deleteTrialLicense ()

## Detailed Description

KeyzyLicenseManager class should be used to set or delete licenses on a client machine.

## Constructor & Destructor Documentation

## ◆ KeyzyLicenseManager()

Keyzy::KeyzyLicenseManager::KeyzyLicenseManager | ( | std::shared_ptr< KeyzyLicenseProvider > | licenseProvider | ) |

Create an instance of KeyzyLicenseManager that will manipulate licenses for a product defined in ProductData structure

Parameters

  productData | Structure that describes a product for which going to set/delete licenses
  licenseProvider | is for not to create multiple object to prevent when update the license, update the provider

## Member Function Documentation

## ◆ setSerialNumber()

bool Keyzy::KeyzyLicenseManager::setSerialNumber | ( | const std::string & | serial_number | ) |

Write serial number to a client machine. This serial should be used by KeyzyLicenseValidator to validate if serial number is valid.

Parameters

  serial_number | Serial number

Returns
  true if serial has been set successfully, otherwise false

## ◆ setLicenseFile()

bool Keyzy::KeyzyLicenseManager::setLicenseFile | ( | const std::string & | license_file_path | ) |

Write license file to a client machine. This license file should be used by KeyzyLicenseValidator to validate if license file is valid.

Parameters

  license_file_path | Absolute path to license file

Returns
  true if license file has been set successfully, otherwise false

## ◆ downloadLicenseFile() [1/2]

LicenseStatus Keyzy::KeyzyLicenseManager::downloadLicenseFile | ( |  | ) |
| noexcept

Download license file from Keyzy server and write license file to a client machine. This license file should be used by KeyzyLicenseValidator to validate if license file is valid.

Returns
  License status.

## ◆ downloadLicenseFile() [2/2]

LicenseStatus Keyzy::KeyzyLicenseManager::downloadLicenseFile | ( | const std::string & | serial_number | ) |
| noexcept

Download license file from Keyzy server and write license file to a client machine. This license file should be used by KeyzyLicenseValidator to validate if license file is valid.

Parameters

  serial_number | Serial number

Returns
  License status

## ◆ upgradeLicense()

LicenseStatus Keyzy::KeyzyLicenseManager::upgradeLicense | ( | const std::string & | source_serial,
|  | const std::string & | target_serial )
| noexcept

Upgrade a license

Parameters

  source_serial | Source serial number
  target_serial | Target serial number to upgrade to

Returns
  License status

## ◆ setTrialLicense()

bool Keyzy::KeyzyLicenseManager::setTrialLicense | ( | std::tm | dueDate | ) |

Set trial license.

Write trial license to a client machine. This trial license should be used by KeyzyLicenseValidator to validate if license file is valid.

Parameters

  dueData | Due date of trial license

Returns
  true if trial license has been set successfully, otherwise false

## ◆ deleteSerialNumber()

bool Keyzy::KeyzyLicenseManager::deleteSerialNumber | ( |  | ) |

Delete serial number from a client machine

Returns
  true if serial number has been deleted successfully, otherwise false

## ◆ deleteLicenseFile()

bool Keyzy::KeyzyLicenseManager::deleteLicenseFile | ( |  | ) |

Delete license file from a client machine

Returns
  true if license file has been deleted successfully, otherwise false

## ◆ deleteTrialLicense()

bool Keyzy::KeyzyLicenseManager::deleteTrialLicense | ( |  | ) |

Delete trial license from a client machine

Returns
  true if trial license has been deleted successfully, otherwise false