Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sourcetap.license
Class LicenseGenerator  view LicenseGenerator download LicenseGenerator.java

java.lang.Object
  extended bycom.sourcetap.license.LicenseGenerator

public class LicenseGenerator
extends java.lang.Object

Generate an encrypted license

Version:
$Revision$

Constructor Summary
LicenseGenerator()
           
 
Method Summary
static java.lang.String generateLicense(java.lang.String license, java.lang.String privateKeyFile)
          return an encrypted license by signing the license with the private key file and encoding the result in Base64
static java.security.PrivateKey readPrivateKey(java.lang.String URI)
          read a private key from the specified file
private static void saveSignature(java.lang.String signature, java.lang.String signatureFile)
           
private static java.lang.String signMessage(java.lang.String message, java.lang.String privateKeyFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LicenseGenerator

public LicenseGenerator()
Method Detail

generateLicense

public static java.lang.String generateLicense(java.lang.String license,
                                               java.lang.String privateKeyFile)
                                        throws LicenseException
return an encrypted license by signing the license with the private key file and encoding the result in Base64


signMessage

private static java.lang.String signMessage(java.lang.String message,
                                            java.lang.String privateKeyFile)
                                     throws java.io.IOException,
                                            java.security.NoSuchAlgorithmException,
                                            java.security.NoSuchProviderException,
                                            java.security.InvalidKeyException,
                                            java.security.SignatureException,
                                            java.security.spec.InvalidKeySpecException

saveSignature

private static void saveSignature(java.lang.String signature,
                                  java.lang.String signatureFile)
                           throws java.io.IOException

readPrivateKey

public static java.security.PrivateKey readPrivateKey(java.lang.String URI)
                                               throws LicenseException
read a private key from the specified file