com.liferay.util
Class Encryptor
java.lang.Object
com.liferay.util.Encryptor
public class Encryptor
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ENCODING
public static final String ENCODING
- See Also:
- Constant Field Values
KEY_ALGORITHM
public static final String KEY_ALGORITHM
- See Also:
- Constant Field Values
SUN_PROVIDER_CLASS
public static final String SUN_PROVIDER_CLASS
- See Also:
- Constant Field Values
IBM_PROVIDER_CLASS
public static final String IBM_PROVIDER_CLASS
- See Also:
- Constant Field Values
PROVIDER_CLASS
public static final String PROVIDER_CLASS
Encryptor
public Encryptor()
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
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