com.waveset.util
Class SignatureUtil

java.lang.Object
  extended bycom.waveset.util.SignatureUtil

public class SignatureUtil
extends java.lang.Object

This is a utility class for sign and verify the signature.

Since:
1.0
Version:
$Revision: 1.1 $ created: 2-10-2001

Field Summary
static java.lang.String code_id
           
 
Method Summary
static java.lang.String sign(java.lang.String data, byte[] encodedPrivateKey)
          This method creates the signature based on the license data and the private key.
static boolean verify(java.lang.String data, byte[] signature, byte[] encodedPublicKey)
          This method validate license data based on the signature and the public key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Method Detail

sign

public static java.lang.String sign(java.lang.String data,
                                    byte[] encodedPrivateKey)
                             throws java.security.GeneralSecurityException
This method creates the signature based on the license data and the private key. It is called by the LicenseTool to create the license.

Parameters:
data - the license data.
encodedPrivateKey - the private key.
Returns:
the encoded signature.
Throws:
java.security.GeneralSecurityException

verify

public static boolean verify(java.lang.String data,
                             byte[] signature,
                             byte[] encodedPublicKey)
                      throws java.security.GeneralSecurityException
This method validate license data based on the signature and the public key. It is called by the LicenseManager to validate the license.

Parameters:
data - the license data.
encodedPublicKey - the public key.
Returns:
a boolean whether or the license is valid.
Throws:
java.security.GeneralSecurityException