com.liferay.util
Class Encryptor
java.lang.Object
com.liferay.util.Encryptor
public class Encryptor
- extends Object
- See Also:
com.liferay.petra.encryptor.Encryptor
| 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
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
Encryptor
public Encryptor()
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
deserializeKey
public static Key deserializeKey(String base64String)
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
serializeKey
public static String serializeKey(Key key)