当前位置: 首页>>代码示例>>Java>>正文


Java BasicTextEncryptor.decrypt方法代码示例

本文整理汇总了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, "");
        }
    }
}
 
开发者ID:GlitchCog,项目名称:ChatGameFontificator,代码行数:22,代码来源:FontificatorProperties.java

示例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);

}
 
开发者ID:SchweizerischeBundesbahnen,项目名称:releasetrain,代码行数:10,代码来源:EncryptorImpl.java

示例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);
}
 
开发者ID:jaschenk,项目名称:jeffaschenk-commons,代码行数:13,代码来源:SecurityServiceProviderUtility.java

示例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);
    }
}
 
开发者ID:debop,项目名称:debop4j,代码行数:15,代码来源:JasyptTest.java

示例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);
}
 
开发者ID:SungardAS,项目名称:enhanced-snapshots,代码行数:7,代码来源:CryptoServiceImpl.java

示例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");
}
 
开发者ID:SferaDev,项目名称:DanaCast,代码行数:7,代码来源:SpliveApp.java


注:本文中的org.jasypt.util.text.BasicTextEncryptor.decrypt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。