本文整理匯總了Java中org.apache.shiro.authc.credential.HashedCredentialsMatcher.setHashIterations方法的典型用法代碼示例。如果您正苦於以下問題:Java HashedCredentialsMatcher.setHashIterations方法的具體用法?Java HashedCredentialsMatcher.setHashIterations怎麽用?Java HashedCredentialsMatcher.setHashIterations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.shiro.authc.credential.HashedCredentialsMatcher
的用法示例。
在下文中一共展示了HashedCredentialsMatcher.setHashIterations方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(
Random.SHA1);
matcher.setHashIterations(Random.ITERATION);
setCredentialsMatcher(matcher);
}
示例2: 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);
}
示例3: 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;
}
示例4: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* 設定密碼校驗的Hash算法與迭代次數
*/
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(MD5Util.HASH_ALGORITHM);
matcher.setHashIterations(MD5Util.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
}
示例5: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* 設定密碼校驗的Hash算法與迭代次數
*/
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(SystemService.HASH_ALGORITHM);
matcher.setHashIterations(SystemService.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
}
示例6: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* 設定Password校驗的Hash算法與迭代次數.
*/
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(AccountService.HASH_ALGORITHM);
matcher.setHashIterations(AccountService.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
}
示例7: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* 設定密碼校驗的Hash算法與迭代次數
*/
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(SystemService.HASH_ALGORITHM);
matcher.setHashIterations(SystemService.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
}
示例8: buildRealm
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
public AuthorizingRealm buildRealm(UserService userService, ConfigurationService configService) {
JdbcSaltedRealm realm = new JdbcSaltedRealm(userService, configService);
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher("SHA-256");
matcher.setHashIterations(1024);
matcher.setStoredCredentialsHexEncoded(false);
realm.setCredentialsMatcher(matcher);
return realm;
}
示例9: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* 設定Password校驗的Hash算法與迭代次數.
*/
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(
UserConstant.HASH_ALGORITHM);
matcher.setHashIterations(UserConstant.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
}
示例10: AppDbRealm
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
public AppDbRealm() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(EncodeKit.HASH_ALGORITHM);
matcher.setHashIterations(EncodeKit.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
setName("goja_app_realm");
}
示例11: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* 構造器,設定Password校驗的Hash算法與迭代次數.
*/
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(
Digests.SHA512_ALGORITHM);
matcher.setHashIterations(Digests.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
}
示例12: postConstruct
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
@PostConstruct
public void postConstruct() {
setCacheManager(new MemoryConstrainedCacheManager());
RelaxedPropertyResolver propertyResolver = new RelaxedPropertyResolver(env, "shiro.password.");
nbHashIterations = propertyResolver.getProperty("nbHashIterations", Integer.class);
HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(Sha512Hash.ALGORITHM_NAME);
credentialsMatcher.setHashIterations(nbHashIterations);
setCredentialsMatcher(credentialsMatcher);
salt = propertyResolver.getProperty("salt");
}
示例13: initCredentialsMatcher
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* 設定Password校驗的Hash算法與迭代次數.
*/
@PostConstruct
public void initCredentialsMatcher() {
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher(UserService.HASH_ALGORITHM);
matcher.setHashIterations(UserService.HASH_INTERATIONS);
setCredentialsMatcher(matcher);
}
示例14: UserRealm
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* <p>Constructor for UserRealm.</p>
*/
public UserRealm() {
final HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(Sha256Hash.ALGORITHM_NAME);
credentialsMatcher.setHashIterations(1024);
credentialsMatcher.setStoredCredentialsHexEncoded(false);
this.setCredentialsMatcher(credentialsMatcher);
}
示例15: PersistenceRealm
import org.apache.shiro.authc.credential.HashedCredentialsMatcher; //導入方法依賴的package包/類
/**
* Constructor adds EhCacheManager.
*/
public PersistenceRealm() {
super(
new EhCacheManager());
// set hashed credentials matcher
HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(HASH_ALGORITHM);
credentialsMatcher.setHashIterations(HASH_ITERATIONS);
credentialsMatcher.setStoredCredentialsHexEncoded(false);
setCredentialsMatcher(credentialsMatcher);
}