smart-license is an open source project for security reinforcement. Major service in the non-open source, commercial software, with the trial of paid software and other functions, to provide for the use of authorized software system.
Applicable scene:
- Non-open source, commercial software, free software.
- Limit the spread of the product, each customer has the exclusive License.
- One software distribution package according to License to provide different services in different capacity.
- Limited software licensing aging
License running processes
-
License Application Process
-
Retrieve License
Use
Generate License
-
Download smart-license.tar.gz , extract.
-
Go to the bin directory execute the following command, for example:
./license.sh 1d HelloWorld
.Under the actual scene can be authorized by the license is valid and different product features, such as:
./license.sh 1y features_1:on;features_2:off;
license to be authorized if the content of the file, the same command can be used, for example:./license.sh 1y config.properties
- 1d: any license valid for one day, or one day after the License will expire. Supported formats include lifetime:
- h, 1h: 1 hours; 2h: 2 hours
- d, 1d: 1 days; 10d: 10 days
- y, 1y: 1 Year; 2y: 2 years
- HelloWorld: represents the content to be encrypted license.
- 1d: any license valid for one day, or one day after the License will expire. Supported formats include lifetime:
-
After the successful implementation, it will generate License in the current directory:
license.txt
and License source file:source.txt
. Note: license.txt is available to customers of authority; and source.txt is held by software providers, which contains an encrypted private key, you need to keep
Use License
-
Maven relies introduced
<dependency> <groupId>org.smartboot.license</groupId> <artifactId>license-client</artifactId> <version>1.0.0</version> </dependency>
-
Loading License. Should the License has expired, it will trigger an exception.
public class LicenseTest { public static void main(String[] args) throws Exception { File file=new File("license.txt"); License license = new License(); LicenseConfig licenseConfig=license.loadLicense(file); System.out.println(licenseConfig.getOriginal()); } }
-
Get licenseData and thus start the software configuration.