org.jboss.soa.esb.services.security.util
Class CryptoUtil

java.lang.Object
  extended by org.jboss.soa.esb.services.security.util.CryptoUtil

public final class CryptoUtil
extends java.lang.Object

Author:
Daniel Bevenius

Method Summary
static byte[] copyBytes(byte[] bytes, int length)
           
static byte[] decrypt(byte[] bytes, java.security.Key key, java.lang.String transformation)
           
static byte[] encrypt(byte[] text, java.security.Key key, java.lang.String transformation)
           
static javax.crypto.Cipher getCipher(java.lang.String transformation)
           
static javax.crypto.Cipher getCipherForDecryption(java.lang.String transformation, java.security.Key key)
           
static javax.crypto.Cipher getCipherForEncryption(java.lang.String transformation, java.security.Key key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCipher

public static javax.crypto.Cipher getCipher(java.lang.String transformation)
                                     throws SecurityServiceException
Throws:
SecurityServiceException

getCipherForDecryption

public static javax.crypto.Cipher getCipherForDecryption(java.lang.String transformation,
                                                         java.security.Key key)
                                                  throws SecurityServiceException
Throws:
SecurityServiceException

getCipherForEncryption

public static javax.crypto.Cipher getCipherForEncryption(java.lang.String transformation,
                                                         java.security.Key key)
                                                  throws SecurityServiceException
Throws:
SecurityServiceException

decrypt

public static byte[] decrypt(byte[] bytes,
                             java.security.Key key,
                             java.lang.String transformation)
                      throws SecurityServiceException
Throws:
SecurityServiceException

encrypt

public static byte[] encrypt(byte[] text,
                             java.security.Key key,
                             java.lang.String transformation)
                      throws SecurityServiceException
Throws:
SecurityServiceException

copyBytes

public static byte[] copyBytes(byte[] bytes,
                               int length)