Liferay 6.2-ce-ga5

com.liferay.util
Class Encryptor

java.lang.Object
  extended by com.liferay.util.Encryptor

public class Encryptor
extends Object


Field Summary
static String ENCODING
           
static String IBM_PROVIDER_CLASS
           
static String KEY_ALGORITHM
           
static int KEY_SIZE
           
static String PROVIDER_CLASS
           
static String SUN_PROVIDER_CLASS
           
 
Constructor Summary
Encryptor()
           
 
Method Summary
static String decrypt(Key key, String encryptedString)
           
static byte[] decryptUnencodedAsBytes(Key key, byte[] encryptedBytes)
           
static String decryptUnencodedAsString(Key key, byte[] encryptedBytes)
           
static String digest(String text)
           
static String digest(String algorithm, String text)
           
static String encrypt(Key key, String plainText)
           
static byte[] encryptUnencoded(Key key, byte[] plainBytes)
           
static byte[] encryptUnencoded(Key key, String plainText)
           
static Key generateKey()
           
static Key generateKey(String algorithm)
           
static Provider getProvider()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final String ENCODING
See Also:
Constant Field Values

IBM_PROVIDER_CLASS

public static final String IBM_PROVIDER_CLASS
See Also:
Constant Field Values

KEY_ALGORITHM

public static final String KEY_ALGORITHM

KEY_SIZE

public static final int KEY_SIZE

PROVIDER_CLASS

public static final String PROVIDER_CLASS

SUN_PROVIDER_CLASS

public static final String SUN_PROVIDER_CLASS
See Also:
Constant Field Values
Constructor Detail

Encryptor

public Encryptor()
Method Detail

decrypt

public static String decrypt(Key key,
                             String encryptedString)
                      throws EncryptorException
Throws:
EncryptorException

decryptUnencodedAsBytes

public static byte[] decryptUnencodedAsBytes(Key key,
                                             byte[] encryptedBytes)
                                      throws EncryptorException
Throws:
EncryptorException

decryptUnencodedAsString

public static String decryptUnencodedAsString(Key key,
                                              byte[] encryptedBytes)
                                       throws EncryptorException
Throws:
EncryptorException

digest

public static String digest(String text)

digest

public static String digest(String algorithm,
                            String text)

encrypt

public static String encrypt(Key key,
                             String plainText)
                      throws EncryptorException
Throws:
EncryptorException

encryptUnencoded

public static byte[] encryptUnencoded(Key key,
                                      byte[] plainBytes)
                               throws EncryptorException
Throws:
EncryptorException

encryptUnencoded

public static byte[] encryptUnencoded(Key key,
                                      String plainText)
                               throws EncryptorException
Throws:
EncryptorException

generateKey

public static Key generateKey()
                       throws EncryptorException
Throws:
EncryptorException

generateKey

public static Key generateKey(String algorithm)
                       throws EncryptorException
Throws:
EncryptorException

getProvider

public static Provider getProvider()
                            throws ClassNotFoundException,
                                   IllegalAccessException,
                                   InstantiationException
Throws:
ClassNotFoundException
IllegalAccessException
InstantiationException

Liferay 6.2-ce-ga5