Starschema

  • A betűméret növelése
  • Alapértelmezett betűméret
  • A betűméret csökkentése

Starschema License Manager for Java (slm4j)

Slm4j project aimed to provide an easy-to-use, easy-to-implement license manager system for java projects.

Basic functionality

The project includes a command line tool to generate private and public keys for cryptographic signing, and a runtime class (or jar module) to validate the generated keys.

The signed data is an ASCII armored file, which could store date or time limitations, functionality restrictions or any user specified strings. The embedded license file validator ensures that file is not modified by using DSA algorythm.

Command line usage

The following command signs input1.txt file and writes the result to output1.txt. If test1.pub (public key file) and test1.pkf (private key file) do not exists, then these files are automatically generated.

$ java -jar SignatureCreator.jar  sign -license input1.txt -public test1.pub \
-private test1.pkf -sign output1.txt

After the initial key generation, the generated key files are used for futher sign actions.

$ java -jar SignatureCreator.jar  sign -license input2.txt -public test1.pub \
-private test1.pkf -sign output2.txt

To verify the generated keys use the "verify" action:

$ java -jar SignatureCreator.jar verify -sign output1.txt -public test1.pub
License is valid
$ java -jar SignatureCreator.jar verify -sign output2.txt -public test1.pub
License is valid

To check what happens if we modify the generated license file use our favourite editor and try it:

$ vim output2.txt
$ java -jar SignatureCreator.jar verify -sign output2.txt -public test1.pub
License is not valid

Usage from java programs

To validate a user supplied license file in your application, you must include your public key file in the binary distribution (eg. in a hardcoded static private string in your license handler class) and import SignatureValidator.jar file. To check the input license file, issue:

 private static final String PUBLIC_KEY = "...";

try {
if ( verifyLicenseWithString( PUBLIC_KEY, fileToValidate ) )
System.out.println("License is valid");
} else {
System.out.println("License is not valid");
}
} catch (SlmException ex) {
System.out.println("Can not load license information: " + ex.getMessage() );
}

For more information please refer to included javadocs.

Example license file

The following file was generated by slm4j:

----- BEGIN LICENSE -----
RegistredTo=John Smith
ExpirationDate=20090630
Version=Full
----- END LICENSE -----
----- BEGIN SIGNATURE -----
MCwCFCKRoTnYFdE7JJzH
W2XQddSq9wqCR43hRQ+J
BZV5FS+ZU5j90JAZFUA2
WQ==
----- END SIGNATURE -----

Downloads

Souce code: slm4j-src-1.00.zip (81k, ZIP)
JAR files: slm4j-bin-1.00.zip (69k, ZIP)

To access source code online or for pull requests please visit project's home on github.

License

Released under BSD license

 



ContactKérem hívjon, ha több információra lenne szüksége:
+36 1 445 0390


Feliratkozás a Starschema Hírlevélre




Starschema 2.0

Lépjen velünk kapcsolatba az alábbi közösségi oldalakon is:
blogger   Blog
twitter   Twitter
facebook   Facebook
google buzz   Buzz
linkedin   LinkedIn
slideshare   SlideShare

A Starschema csapat és a Wincor-Nixdorfa hitelintézeti szektor és a kereskedelmi láncok vezető megoldásszállító cége együttműködésében került kifejlesztésre az masszívan párhuzamos analítikus adattárház megoldás...(Bővebben...)
A Starschema csapat sikeresen zárta le Magyarország és valószínűleg a régió legnagyobb Oracle adattárház és SAP BusinessObjects BI és DI migrációs projektjét.
Főbb eredmények:...(Bővebben...)
Megérkezett az SAP BusinessObjects új, 4.0 béta verziója - teszteljük
A Starschema csapat részt vesz a SAP BO 4.0 termékcsalád béta tesztelésében...

(Bővebben...)