com.foxsmart.ic.util
Class SecurityUtils

java.lang.Object
  extended by com.foxsmart.ic.util.SecurityUtils

public class SecurityUtils
extends java.lang.Object

This class provides various security utilities via static methods.


Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
SecurityUtils()
           
 
Method Summary
static java.lang.String getSignature(java.security.PrivateKey privateKey, java.util.List<java.lang.String> values)
          Gets a signature based on the private key and list of values.
static boolean getSignatureValid(java.security.PublicKey publicKey, java.util.List<java.lang.String> values, java.lang.String signature)
          Returns whether the signature for this license cache information is valid or not.
static void updateSignature(java.security.Signature signatureObject, java.util.List<java.lang.String> values)
          Updates a signature with a list of values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Constructor Detail

SecurityUtils

public SecurityUtils()
Method Detail

getSignatureValid

public static boolean getSignatureValid(java.security.PublicKey publicKey,
                                        java.util.List<java.lang.String> values,
                                        java.lang.String signature)
Returns whether the signature for this license cache information is valid or not.

Parameters:
publicKey - the public key to use to verify the signature.
values - the list of values to verify.
signature - the signature to verify against.
Returns:
True if the signature is valid or false if not.

updateSignature

public static void updateSignature(java.security.Signature signatureObject,
                                   java.util.List<java.lang.String> values)
                            throws java.security.SignatureException
Updates a signature with a list of values.

Parameters:
signatureObject - the signature to update.
values - the list of values.
Throws:
java.security.SignatureException - if any problems were encountered updating the signature.

getSignature

public static java.lang.String getSignature(java.security.PrivateKey privateKey,
                                            java.util.List<java.lang.String> values)
                                     throws java.security.NoSuchAlgorithmException,
                                            java.security.InvalidKeyException,
                                            java.security.SignatureException
Gets a signature based on the private key and list of values.

Parameters:
privateKey - the private key.
values - the list of values.
Returns:
the signature.
Throws:
java.security.NoSuchAlgorithmException - if an algorithm couldn't be determined.
java.security.InvalidKeyException - if the key is invalid.
java.security.SignatureException - if the signature couldn't be generated.


Copyright © 2005-2008 Fox Smart, Inc. All Rights Reserved.