當前位置: 首頁>>代碼示例>>Java>>正文


Java HashedCredentialsMatcher.setHashAlgorithmName方法代碼示例

本文整理匯總了Java中org.apache.shiro.authc.credential.HashedCredentialsMatcher.setHashAlgorithmName方法的典型用法代碼示例。如果您正苦於以下問題:Java HashedCredentialsMatcher.setHashAlgorithmName方法的具體用法?Java HashedCredentialsMatcher.setHashAlgorithmName怎麽用?Java HashedCredentialsMatcher.setHashAlgorithmName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.shiro.authc.credential.HashedCredentialsMatcher的用法示例。


在下文中一共展示了HashedCredentialsMatcher.setHashAlgorithmName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setCredentialMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
 * 用戶的登錄的明文密碼,先經過md5加密再和數據庫比對
 */
@PostConstruct
public void setCredentialMatcher() {
	HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
	credentialsMatcher.setHashAlgorithmName("MD5");
	credentialsMatcher.setHashIterations(1024);
	setCredentialsMatcher(credentialsMatcher);
}
 
開發者ID:MarchMachao,項目名稱:ZHFS-WEB,代碼行數:11,代碼來源:MyRealm.java

示例2: hashedCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
 * HashCredentialsMatcher,對密碼進行編碼
 */
@Bean(name = "hashCredentialsMatcher")
public HashedCredentialsMatcher hashedCredentialsMatcher(){
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName("MD5");
    credentialsMatcher.setHashIterations(2); //散列兩次
    credentialsMatcher.setStoredCredentialsHexEncoded(true);
    return credentialsMatcher;
}
 
開發者ID:ZhuXS,項目名稱:Spring-Shiro-Spark,代碼行數:12,代碼來源:ShiroConfig.java

示例3: jdbcRealm

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
@Bean(name = "jdbcRealm")
@DependsOn("lifecycleBeanPostProcessor")
public JdbcRealm jdbcRealm() {
    JdbcRealm realm = new JdbcRealm();
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
    credentialsMatcher.setHashAlgorithmName(Sha256Hash.ALGORITHM_NAME);
    realm.setCredentialsMatcher(credentialsMatcher);
    realm.setDataSource(dataSource);
    realm.init();
    return realm;
}
 
開發者ID:mraible,項目名稱:java-webapp-security-examples,代碼行數:12,代碼來源:WebSecurityConfig.java

示例4: provideCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
 * When annotations activated, you'll need to hash passwords in your configured Realm (i.e.: shiro.ini file)
 * @return credentialsMatcher singleton implementation for this application
 */
//@Provides
//@Singleton
public CredentialsMatcher provideCredentialsMatcher(){
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher();
	matcher.setHashAlgorithmName(CREDENTIALS_MATCHER_ALGORITHM_NAME);
	return matcher;
}
 
開發者ID:pabiagioli,項目名稱:secure-rest-webapp-archetype,代碼行數:12,代碼來源:BootstrapShiroModule.java

示例5: provideCredentialsMatcher

import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
 * When annotations activated, you'll need to hash passwords in your configured Realm (i.e.: shiro.ini file)
 * @return credentialsMatcher singleton implementation for this application
 */
//@Provides
//@Singleton
public CredentialsMatcher provideCredentialsMatcher(){
	logger.entry();
	HashedCredentialsMatcher matcher = new HashedCredentialsMatcher();
	matcher.setHashAlgorithmName(CREDENTIALS_MATCHER_ALGORITHM_NAME);
	logger.exit(matcher);
	return matcher;
}
 
開發者ID:pabiagioli,項目名稱:shiro-guice-async-webapp,代碼行數:14,代碼來源:BootstrapShiroModule.java


注:本文中的org.apache.shiro.authc.credential.HashedCredentialsMatcher.setHashAlgorithmName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。