GithubHelp home page GithubHelp logo

kron0s / licensee Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bart/licensee

0.0 2.0 0.0 84 KB

Simple PHP class for license generation and verification based on openssl signatures

PHP 100.00%

licensee's Introduction

Licensee

Latest Stable Version License ProjectStatus

A simple PHP class for license generation and verification based on openssl signatures

Usage

Using the Licensee class is as easy as pie, because it follows the PSR-0 namespace standard.

  1. Add "bart/licensee":"dev-master" to your composer.json require-dev
  2. Run composer update
  3. Enjoy!

Note: If you developing with the amazing Laravel 4 framework, you can add an alias: 'License' => 'Bart\Licensee\License'

Methods

createLicense($data, $private_key_path, [$license_path])
storeLicense($license_path)
validateLicense($license_path, $public_key_path)
getDataAndValidateLicense($license_path, $public_key_path)
createKeypair([$private_key_path], [$public_key_path])

Example

$lic = new License();

// The array we want to create a license from
$data = array(
  'licensee' => 'Company name',
  'version' => '1.0',
  'valid_until' => time() + 60*60*24,
  'key' => sha1(uniqid(true))
);

// Create a new public and private key
$lic::createKeypair('/tmp/private.pem', '/tmp/public.pem');

// Create the license
$lic->createLicense($data, '/tmp/private.pem', '/tmp/license.lic');

// Validate the license and get the data back
$valid_data = $lic->getDataAndValidateLicense('/tmp/license.lic', '/tmp/public.pem');

License

The Licensee package is open-sourced software licensed under the MIT license

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.