本文整理汇总了Java中org.jasypt.util.text.BasicTextEncryptor.decrypt方法的典型用法代码示例。如果您正苦于以下问题:Java BasicTextEncryptor.decrypt方法的具体用法?Java BasicTextEncryptor.decrypt怎么用?Java BasicTextEncryptor.decrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jasypt.util.text.BasicTextEncryptor
的用法示例。
在下文中一共展示了BasicTextEncryptor.decrypt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decryptProperty
import org.jasypt.util.text.BasicTextEncryptor; //导入方法依赖的package包/类
public void decryptProperty(String key)
{
BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
textEncryptor.setPassword(ENC_PASSWORD);
final String encryptedValue = getProperty(key);
if (encryptedValue != null && !encryptedValue.isEmpty())
{
try
{
final String decryptedValue = textEncryptor.decrypt(encryptedValue);
setProperty(key, decryptedValue);
}
catch (Exception e)
{
final String errorMessage = "Error decrypting value for " + key + " property";
logger.error(errorMessage, e);
ChatWindow.popup.handleProblem(errorMessage);
setProperty(key, "");
}
}
}
示例2: decrypt
import org.jasypt.util.text.BasicTextEncryptor; //导入方法依赖的package包/类
public static String decrypt(final String encryptedVal) {
if (encryptedVal == null) {
return null;
}
BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
textEncryptor.setPassword(MY_ENCRIPTED_PASSWORD);
return textEncryptor.decrypt(encryptedVal);
}
示例3: decryptMessage
import org.jasypt.util.text.BasicTextEncryptor; //导入方法依赖的package包/类
/**
* DeCrypt a BASE64 Encoded Encrypted Message to Plain text.
*
* @param encryptedMessage
* @return String - Decrypted Message String
*/
public static String decryptMessage(String encryptedMessage) {
initializeDefaultCryptographyProvider();
BasicTextEncryptor basicTextEncryptor = new BasicTextEncryptor();
basicTextEncryptor.setPassword(SALT_PW);
return basicTextEncryptor.decrypt(encryptedMessage);
}
示例4: basicTestEncryptor
import org.jasypt.util.text.BasicTextEncryptor; //导入方法依赖的package包/类
@Test
public void basicTestEncryptor() {
for (String algorithm : EncryptorAlgorithms) {
BasicTextEncryptor encryptor = new BasicTextEncryptor();
encryptor.setPassword("debop");
String encrypted = encryptor.encrypt(PLAIN_TEXT);
String decrypted = encryptor.decrypt(encrypted);
Assert.assertEquals(PLAIN_TEXT, decrypted);
}
}
示例5: decrypt
import org.jasypt.util.text.BasicTextEncryptor; //导入方法依赖的package包/类
@Override
public String decrypt(String privateKey, String encrypted) {
BasicTextEncryptor encryptor = new BasicTextEncryptor();
encryptor.setPassword(privateKey);
return encryptor.decrypt(encrypted);
}
示例6: main
import org.jasypt.util.text.BasicTextEncryptor; //导入方法依赖的package包/类
private void main() {
// Lists: http://pastebin.com/ELJcaJhb
BasicTextEncryptor encryptor = new BasicTextEncryptor();
encryptor.setPassword("c6ka74t4b2dv");
encryptor.decrypt("CSo89epohd25+1KsO6MsYRRHmM1nLoasZi226iSH5L6CjLWZ6CKzl+Alo8Tt/5UxSpY1GD9B8M+NOGguQwd4I10eK006EHpbHqd6yrNyKytaNLcWNIJJlkSVWZQNgqhl");
}