• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StandardStringDigester类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jasypt.digest.StandardStringDigester的典型用法代码示例。如果您正苦于以下问题:Java StandardStringDigester类的具体用法?Java StandardStringDigester怎么用?Java StandardStringDigester使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StandardStringDigester类属于org.jasypt.digest包,在下文中一共展示了StandardStringDigester类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDigester

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
private static StandardStringDigester getDigester(final String cipherAlgorithm) {
    StandardStringDigester digester = new StandardStringDigester();

    if (cipherAlgorithm.startsWith("S-")) {
        // Salted ...
        digester.setAlgorithm(cipherAlgorithm.replaceFirst("S\\-", ""));
        digester.setIterations(1);
        digester.setSaltSizeBytes(8);
        digester.setInvertPositionOfPlainSaltInEncryptionResults(true);
        digester.setInvertPositionOfSaltInMessageBeforeDigesting(true);
        digester.setUseLenientSaltSizeCheck(true);
    } else {
        // Not salted ...
        digester.setAlgorithm(cipherAlgorithm);
        digester.setIterations(1);
        digester.setSaltSizeBytes(0);
    }

    digester.setStringOutputType(CommonUtils.STRING_OUTPUT_TYPE_HEXADECIMAL);
    return digester;
}
 
开发者ID:apache,项目名称:syncope,代码行数:22,代码来源:MavenUtils.java


示例2: getDigester

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
private StandardStringDigester getDigester(final CipherAlgorithm cipherAlgorithm) {
    StandardStringDigester digester = new StandardStringDigester();

    if (cipherAlgorithm.getAlgorithm().startsWith("S-")) {
        // Salted ...
        digester.setAlgorithm(cipherAlgorithm.getAlgorithm().replaceFirst("S\\-", ""));
        digester.setIterations(SALT_ITERATIONS);
        digester.setSaltSizeBytes(SALT_SIZE_BYTES);
        digester.setInvertPositionOfPlainSaltInEncryptionResults(IPOPSIER);
        digester.setInvertPositionOfSaltInMessageBeforeDigesting(IPOSIMBD);
        digester.setUseLenientSaltSizeCheck(ULSSC);
    } else {
        // Not salted ...
        digester.setAlgorithm(cipherAlgorithm.getAlgorithm());
        digester.setIterations(1);
        digester.setSaltSizeBytes(0);
    }

    digester.setStringOutputType(CommonUtils.STRING_OUTPUT_TYPE_HEXADECIMAL);
    return digester;
}
 
开发者ID:apache,项目名称:syncope,代码行数:22,代码来源:Encryptor.java


示例3: StrongPasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>StrongPasswordEncryptor</tt>
 *
 */
public StrongPasswordEncryptor() {
    super();
    this.digester = new StandardStringDigester();
    this.digester.setAlgorithm("SHA-256");
    this.digester.setIterations(100000);
    this.digester.setSaltSizeBytes(16);
    this.digester.initialize();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:StrongPasswordEncryptor.java


示例4: RFC2307SMD5PasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>RFC2307OpenLDAPSSHAPasswordEncryptor</tt>
 *
 */
public RFC2307SMD5PasswordEncryptor() {
    super();
    this.digester = new StandardStringDigester();
    this.digester.setAlgorithm("MD5");
    this.digester.setIterations(1);
    this.digester.setSaltSizeBytes(8);
    this.digester.setPrefix("{SMD5}");
    this.digester.setInvertPositionOfSaltInMessageBeforeDigesting(true);
    this.digester.setInvertPositionOfPlainSaltInEncryptionResults(true);
    this.digester.setUseLenientSaltSizeCheck(true);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:16,代码来源:RFC2307SMD5PasswordEncryptor.java


示例5: RFC2307SSHAPasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>RFC2307OpenLDAPSSHAPasswordEncryptor</tt>
 *
 */
public RFC2307SSHAPasswordEncryptor() {
    super();
    this.digester = new StandardStringDigester();
    this.digester.setAlgorithm("SHA-1");
    this.digester.setIterations(1);
    this.digester.setSaltSizeBytes(8);
    this.digester.setPrefix("{SSHA}");
    this.digester.setInvertPositionOfSaltInMessageBeforeDigesting(true);
    this.digester.setInvertPositionOfPlainSaltInEncryptionResults(true);
    this.digester.setUseLenientSaltSizeCheck(true);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:16,代码来源:RFC2307SSHAPasswordEncryptor.java


示例6: RFC2307SHAPasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>RFC2307SHAPasswordEncryptor</tt>
 *
 */
public RFC2307SHAPasswordEncryptor() {
    super();
    this.digester = new StandardStringDigester();
    this.digester.setAlgorithm("SHA-1");
    this.digester.setIterations(1);
    this.digester.setSaltSizeBytes(0);
    this.digester.setPrefix("{SHA}");
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:RFC2307SHAPasswordEncryptor.java


示例7: RFC2307MD5PasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>RFC2307MD5PasswordEncryptor</tt>
 *
 */
public RFC2307MD5PasswordEncryptor() {
    super();
    this.digester = new StandardStringDigester();
    this.digester.setAlgorithm("MD5");
    this.digester.setIterations(1);
    this.digester.setSaltSizeBytes(0);
    this.digester.setPrefix("{MD5}");
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:RFC2307MD5PasswordEncryptor.java


示例8: archetypeProperties

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
private Properties archetypeProperties(
        final String archetypeVersion,
        final String groupId,
        final String artifactId,
        final String secretKey,
        final String anonymousKey,
        final String jwsKey,
        final String adminPassword) {

    final Properties properties = new Properties();
    properties.setProperty("archetypeGroupId", "org.apache.syncope");
    properties.setProperty("archetypeArtifactId", "syncope-archetype");
    properties.setProperty("archetypeRepository",
            archetypeVersion.contains("SNAPSHOT")
            ? "http://repository.apache.org/content/repositories/snapshots"
            : "http://repo1.maven.org/maven2");
    properties.setProperty("archetypeVersion", archetypeVersion);
    properties.setProperty("groupId", groupId);
    properties.setProperty("artifactId", artifactId);
    properties.setProperty("secretKey", secretKey);
    properties.setProperty("anonymousKey", anonymousKey);
    properties.setProperty("jwsKey", jwsKey);

    if (adminPassword != null) {
        StandardStringDigester digester = getDigester("S-SHA-256");
        String encodedPassword = digester.digest(adminPassword);
        properties.setProperty("adminPassword", encodedPassword);
    }
    properties.setProperty("version", "1.0-SNAPSHOT");
    return properties;
}
 
开发者ID:apache,项目名称:syncope,代码行数:32,代码来源:MavenUtils.java


示例9: unidirectional_digest

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Unidirectional Digest
 *
 * @param message incoming message String
 * @return String Unidirectional Digest
 */
public static String unidirectional_digest(final String message) {
    initializeDefaultCryptographyProvider();
    StandardStringDigester digester = new StandardStringDigester();
    digester.setAlgorithm(BC_ALGORITHM_NAME);
    return digester.digest(message);
}
 
开发者ID:jaschenk,项目名称:jeffaschenk-commons,代码行数:13,代码来源:SecurityServiceProviderUtility.java


示例10: bidirectional_digest

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Bidirectional Digest
 *
 * @param message incoming message String
 * @return String Bidirectional Digest
 */
public static String bidirectional_digest(final String message) {
    initializeDefaultCryptographyProvider();
    StandardStringDigester digester = new StandardStringDigester();
    digester.setAlgorithm(BC_ALGORITHM_NAME);
    digester.setSaltGenerator(getSaltGenerator());
    return digester.digest(message);
}
 
开发者ID:jaschenk,项目名称:jeffaschenk-commons,代码行数:14,代码来源:SecurityServiceProviderUtility.java


示例11: checkDigest

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Bidirectional Digest Match
 *
 * @param message incoming message String
 * @param digest  Bidirectional Digest
 * @return boolean indicator, True if String and Digest Match, False if not.
 */
public static boolean checkDigest(final String message, final String digest) {
    initializeDefaultCryptographyProvider();
    StandardStringDigester digester = new StandardStringDigester();
    digester.setAlgorithm(BC_ALGORITHM_NAME);
    digester.setSaltGenerator(getSaltGenerator());
    return digester.matches(message, digest);
}
 
开发者ID:jaschenk,项目名称:jeffaschenk-commons,代码行数:15,代码来源:SecurityServiceProviderUtility.java


示例12: standardStringDigester

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
@Bean
public StandardStringDigester standardStringDigester() {
    StandardStringDigester ssd = new StandardStringDigester();
    ssd.setConfig(environmentStringDigesterConfig());

    return ssd;
}
 
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:8,代码来源:EncryptionConfig.java


示例13: StringDigesterBase

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Instantiates a new String digester base.
 *
 * @param iterations the iterations
 */
public StringDigesterBase(int iterations) {
    standardStringDigester = new StandardStringDigester();
    standardStringDigester.setAlgorithm(getAlgorithm());
    standardStringDigester.setIterations(iterations);

    if (log.isDebugEnabled())
        log.debug("문자열을 암호화하는 [{}] 인스턴스를 생성했습니다. algorithm=[{}], iteration=[{}]",
                getClass().getName(), getAlgorithm(), iterations);
}
 
开发者ID:debop,项目名称:debop4j,代码行数:15,代码来源:StringDigesterBase.java


示例14: standardStringDigester

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
@Test
public void standardStringDigester() {

    for (String algorithm : DiageterAlgorithms) {
        StandardStringDigester digester = new StandardStringDigester();
        digester.setAlgorithm(algorithm);
        digester.setIterations(10);
        String digest = digester.digest("password");

        Assert.assertFalse(digester.matches("Password", digest));
        Assert.assertFalse(digester.matches("passworD", digest));
        Assert.assertTrue(digester.matches("password", digest));
    }

}
 
开发者ID:debop,项目名称:debop4j,代码行数:16,代码来源:JasyptTest.java


示例15: CartPasswordEncoder

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
public CartPasswordEncoder(){
	digester = new StandardStringDigester();
}
 
开发者ID:PacktPublishing,项目名称:Spring-MVC-Blueprints,代码行数:4,代码来源:CartPasswordEncoder.java


示例16: ConfigurablePasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>ConfigurablePasswordEncryptor</tt>
 *
 */
public ConfigurablePasswordEncryptor() {
    super();
    this.digester = new StandardStringDigester();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:9,代码来源:ConfigurablePasswordEncryptor.java


示例17: BasicPasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>BasicPasswordEncryptor</tt>
 *
 */
public BasicPasswordEncryptor() {
    super();
    this.digester = new StandardStringDigester();
    this.digester.initialize();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:10,代码来源:BasicPasswordEncryptor.java


示例18: HexPasswordEncryptor

import org.jasypt.digest.StandardStringDigester; //导入依赖的package包/类
/**
 * Creates a new instance of <tt>BasicPasswordEncryptor</tt>
 *
 */
public HexPasswordEncryptor() {
    this.digester = new StandardStringDigester();
    this.digester.setStringOutputType("hexadecimal");
    this.digester.initialize();
}
 
开发者ID:geralddejong,项目名称:darwinathome,代码行数:10,代码来源:HexPasswordEncryptor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BaseMod类代码示例发布时间:2022-05-23
下一篇:
Java PathHierarchyTokenizer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap