public class HashedCredentialsMatcher extends SimpleCredentialsMatcher
PREFERRED_ENCODING| 构造器和说明 |
|---|
HashedCredentialsMatcher()
JavaBeans-compatibile no-arg constructor intended for use in IoC/Dependency Injection environments.
|
HashedCredentialsMatcher(String hashAlgorithmName)
Creates an instance using the specified
hashAlgorithmName to hash submitted
credentials. |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
doCredentialsMatch(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.authc.AuthenticationInfo info)
This implementation acquires the
token's credentials
(via getCredentials(token))
and then the account's credentials
(via getCredentials(account)) and then passes both of
them to the equals(tokenCredentials, accountCredentials) method for equality
comparison. |
String |
getHashAlgorithmName()
Returns the
Hash algorithmName to use
when performing hashes for credentials matching. |
int |
getHashIterations() |
boolean |
isHashSalted()
已过时。
|
boolean |
isStoredCredentialsHexEncoded() |
void |
setHashAlgorithmName(String hashAlgorithmName)
Sets the
Hash algorithmName to use
when performing hashes for credentials matching. |
void |
setHashIterations(int hashIterations) |
void |
setHashSalted(boolean hashSalted)
已过时。
|
void |
setStoredCredentialsHexEncoded(boolean storedCredentialsHexEncoded) |
public HashedCredentialsMatcher()
hashAlgorithmName property.public HashedCredentialsMatcher(String hashAlgorithmName)
hashAlgorithmName to hash submitted
credentials.hashAlgorithmName - the Hash algorithmName
to use when performing hashes for credentials matching.public String getHashAlgorithmName()
Hash algorithmName to use
when performing hashes for credentials matching.Hash algorithmName to use
when performing hashes for credentials matching.public void setHashAlgorithmName(String hashAlgorithmName)
Hash algorithmName to use
when performing hashes for credentials matching.hashAlgorithmName - the Hash algorithmName
to use when performing hashes for credentials matching.public boolean isStoredCredentialsHexEncoded()
true if the system's stored credential hash is Hex encoded, false if it
is Base64 encoded. Default is truepublic void setStoredCredentialsHexEncoded(boolean storedCredentialsHexEncoded)
storedCredentialsHexEncoded - the indicator if this system's stored credential hash is Hex
encoded or not ('not' automatically implying it is Base64 encoded).@Deprecated public boolean isHashSalted()
true if a submitted AuthenticationToken's credentials should be salted when hashing,
false if it should not be salted.@Deprecated public void setHashSalted(boolean hashSalted)
hashSalted - whether or not to salt a submitted AuthenticationToken's credentials when hashing.public int getHashIterations()
AuthenticationToken's credentials will be hashed before
comparing to the credentials stored in the system.public void setHashIterations(int hashIterations)
hashIterations - the number of times to hash a submitted AuthenticationToken's credentials.public boolean doCredentialsMatch(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.authc.AuthenticationInfo info)
SimpleCredentialsMatchertoken's credentials
(via getCredentials(token))
and then the account's credentials
(via getCredentials(account)) and then passes both of
them to the equals(tokenCredentials, accountCredentials) method for equality
comparison.doCredentialsMatch 在接口中 org.apache.shiro.authc.credential.CredentialsMatcherdoCredentialsMatch 在类中 SimpleCredentialsMatchertoken - the AuthenticationToken submitted during the authentication attempt.info - the AuthenticationInfo stored in the system matching the token principaltrue if the provided token credentials hash match to the stored account credentials hash,
false otherwiseCopyright © 2015-2017. All Rights Reserved.