Package de.xima.fc.utils
Class EncryptionUtils
- java.lang.Object
-
- de.xima.fc.utils.EncryptionUtils
-
public class EncryptionUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description EncryptionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkSaltedHash(String clearTextValue, String hashedValue)
static byte[]
decrypt(byte[] value, byte[] defaultValue)
static String
decrypt(String value)
static Integer
decrypt(String value, int defaultValue)
static byte[]
encrypt(byte[] value)
static String
encrypt(Integer value)
static String
encrypt(String value)
static org.jasypt.encryption.pbe.PooledPBEByteEncryptor
getBinaryEncryptor()
static String
getKeyStoreTypeByFileName(InputStream input)
Determines theKeyStore
type by the provided input stream.static org.jasypt.encryption.pbe.PooledPBEStringEncryptor
getStringEncryptor()
static String
saltedHash(String clearTextValue)
-
-
-
Method Detail
-
encrypt
public static byte[] encrypt(byte[] value)
-
decrypt
public static byte[] decrypt(byte[] value, byte[] defaultValue)
-
getStringEncryptor
public static org.jasypt.encryption.pbe.PooledPBEStringEncryptor getStringEncryptor()
-
getBinaryEncryptor
public static org.jasypt.encryption.pbe.PooledPBEByteEncryptor getBinaryEncryptor()
-
getKeyStoreTypeByFileName
@Nullable public static String getKeyStoreTypeByFileName(InputStream input)
Determines theKeyStore
type by the provided input stream. Implementation details are taken fromKeyStore.getInstance(java.io.File, char[])
.- Parameters:
input
- the input stream providing the data of the key store.- Returns:
- the key store for the provided input stream.
-
-