Class SecurePasswordEncryption
java.lang.Object
org.pentaho.reporting.libraries.base.util.SecurePasswordEncryption
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
appendAsHexString
(byte[] encryptedData, StringBuffer b) protected static int
bytesToInt
(byte[] data, int offset) decryptPassword
(String password, String key) decryptPassword
(String password, SecretKey key, String algorithm) encryptPassword
(String password, String key) encryptPassword
(String password, SecretKey key, String algorithm) protected static byte[]
intToByte
(int value) protected static byte[]
stringToBytes
(String password)
-
Constructor Details
-
SecurePasswordEncryption
public SecurePasswordEncryption()
-
-
Method Details
-
encryptPassword
public String encryptPassword(String password, String key) throws GeneralSecurityException, UnsupportedEncodingException -
encryptPassword
public String encryptPassword(String password, SecretKey key, String algorithm) throws GeneralSecurityException, UnsupportedEncodingException -
appendAsHexString
-
intToByte
protected static byte[] intToByte(int value) -
decryptPassword
public String decryptPassword(String password, String key) throws UnsupportedEncodingException, GeneralSecurityException -
decryptPassword
public String decryptPassword(String password, SecretKey key, String algorithm) throws UnsupportedEncodingException, GeneralSecurityException -
stringToBytes
- Throws:
UnsupportedEncodingException
-
bytesToInt
protected static int bytesToInt(byte[] data, int offset)
-