Giter Site home page Giter Site logo

javatruelicense's Introduction

JavaTrueLicenseDemo

这是一个Java程序添加license的样例.通过使用true license对程序添加license. 步骤分为如下几步:

  • 通过keytool创建license文件
  • 创建license生成
  • license验证

下面将对其一一进行描述.

1. 通过keytool创建明密文库(store)文件

首先,需要用keytool生成公钥和私钥库.期间,需要设置苦密码,输入公司信息.

keytool -genkey -alias privatekey -keystore privateKeys.store -validity 3650

接下来,需要将公钥单独建库.首先导出公钥,

keytool -export -alias privatekey -file certfile.cer -keystore privateKeys.store

然后将到处的公钥,导入到新的keystore里面去.

keytool -import -alias publiccert -file certfile.cer -keystore publicCerts.store

2. 在程序负责人端通过create创建lic文件

首先,需要拷贝privatekey.store到代码中对应的文件夹下.

cp privatekey.store src/main/java/org/pigeon/license/create

然后依据license内容修改param.properties文件.修改后后,运行testCreateLicense,创建lic结尾的license文件.

3. 在客户端通过lic文件验证使用软件

创建好lic结尾的license文件后,将publicCerts.store拷贝到代码中对应的文件夹下.

cp publicCerts.store src/main/java/org/pigeon/license/verify

然后修改param2.properties文件,使其与param.properties文件中的参数相对应.修改后运行testVerifyLicense.

javatruelicense's People

Contributors

caoheyang avatar

Watchers

 avatar

Forkers

defiphoenix

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.