Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 2.45 KB

README.md

File metadata and controls

65 lines (51 loc) · 2.45 KB

License Manager

A Simple Software License Application
License Manager has three -3- parts. These are a static library liblicense, an acquirer executable license_customer and an issuer executable license_provider.

  • liblicense A static library depended to the openssl crypto library contains functions and type definitions.

  • license_customer An executable used to generate initial license file for application, services, modules.

  • license_provider An executable used to generate final license file from initial one.

Creating a License File

Running license_provider or license_customer without a command-line argument executable generates RSA private/public keys and saves them under working directory as provider.pem, provider-pub.pem and customer.pem, customer-pub.pem. Keep provider-pub.pem together with license_customer executable.

  • license_customer
    loads customer's RSA key,
    loads provider's RSA public key,
    generates a session key,
    encrypts session key with provider's public key,
    builds a license json string from given command-line arguments,
    encrypts license-json-string with session key,
    saves encrypted session key, customer public key and encrypted license-json-string into customer.lic file,
    send customer.lic file to the provider's office, manually.

  • license_provider
    loads provider's RSA key,
    loads customer.lic file,
    parses encrypted session key,
    decrypts session key with provider's private key,
    parses customer's public key,
    creates customer's RSA key from the public key,
    parses encrypted license-json-string,
    decrypts license-json-string with session key,
    build a final license-json-string from given command-line arguments,
    calculates a hash value from license-json-string,
    encrypts the hash value with provider's private key,
    encrypts the previous value with customer's public key,
    saves final license-json-string and it's encrypted hash value into customer.license file,
    send customer.license file to the customer's office, manually.

Sample command-line arguments

  • license_customer client-name provider's-rep-name app-version feature-or-service-name:version feature-or-service-name-2:version-2 ...

  • license_provider 3650

  • license_provider demo

PS: export verify_license, verify_app and verify_service procedures, then call one of this from the application or service you want to make it limited.