public class Encryptor extends Object
com.liferay.petra.encryptor.Encryptor
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Encryptor() |
Modifier and Type | Method and Description |
---|---|
static String |
decrypt(Key key,
String encryptedString) |
static byte[] |
decryptUnencodedAsBytes(Key key,
byte[] encryptedBytes) |
static String |
decryptUnencodedAsString(Key key,
byte[] encryptedBytes) |
static Key |
deserializeKey(String base64String) |
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() |
static String |
serializeKey(Key key) |
public static final String ENCODING
public static final String IBM_PROVIDER_CLASS
public static final String KEY_ALGORITHM
public static final int KEY_SIZE
public static final String PROVIDER_CLASS
public static final String SUN_PROVIDER_CLASS
public static String decrypt(Key key, String encryptedString) throws EncryptorException
EncryptorException
public static byte[] decryptUnencodedAsBytes(Key key, byte[] encryptedBytes) throws EncryptorException
EncryptorException
public static String decryptUnencodedAsString(Key key, byte[] encryptedBytes) throws EncryptorException
EncryptorException
public static String encrypt(Key key, String plainText) throws EncryptorException
EncryptorException
public static byte[] encryptUnencoded(Key key, byte[] plainBytes) throws EncryptorException
EncryptorException
public static byte[] encryptUnencoded(Key key, String plainText) throws EncryptorException
EncryptorException
public static Key generateKey() throws EncryptorException
EncryptorException
public static Key generateKey(String algorithm) throws EncryptorException
EncryptorException
public static Provider getProvider() throws ClassNotFoundException, IllegalAccessException, InstantiationException