/** * Returns a new, <em>uninitialized</em> instance, without its byte array set. Used as a utility method in the * {@link SimpleCredentialsMatcher#getCredentials(org.apache.shiro.authc.AuthenticationInfo) getCredentials(AuthenticationInfo)} implementation. * * @return a new, <em>uninitialized</em> instance, without its byte array set. */ protected AbstractHash newHashInstance() { String hashAlgorithmName = assertHashAlgorithmName(); return new SimpleHash(hashAlgorithmName); }
/** * Hashes the provided credentials a total of {@code hashIterations} times, using the given salt. The hash * implementation/algorithm used is based on the {@link #getHashAlgorithmName() hashAlgorithmName} property. * * @param credentials the submitted authentication token's credentials to hash * @param salt the value to salt the hash, or {@code null} if a salt will not be used. * @param hashIterations the number of times to hash the credentials. At least one hash will always occur though, * even if this argument is 0 or negative. * @return the hashed value of the provided credentials, according to the specified salt and hash iterations. */ protected Hash hashProvidedCredentials(Object credentials, Object salt, int hashIterations) { String hashAlgorithmName = assertHashAlgorithmName(); return new SimpleHash(hashAlgorithmName, credentials, salt, hashIterations); }
/** * Returns a new, <em>uninitialized</em> instance, without its byte array set. Used as a utility method in the * {@link SimpleCredentialsMatcher#getCredentials(org.apache.shiro.authc.AuthenticationInfo) getCredentials(AuthenticationInfo)} implementation. * * @return a new, <em>uninitialized</em> instance, without its byte array set. */ protected AbstractHash newHashInstance() { String hashAlgorithmName = assertHashAlgorithmName(); return new SimpleHash(hashAlgorithmName); }
/** * Hashes the provided credentials a total of {@code hashIterations} times, using the given salt. The hash * implementation/algorithm used is based on the {@link #getHashAlgorithmName() hashAlgorithmName} property. * * @param credentials the submitted authentication token's credentials to hash * @param salt the value to salt the hash, or {@code null} if a salt will not be used. * @param hashIterations the number of times to hash the credentials. At least one hash will always occur though, * even if this argument is 0 or negative. * @return the hashed value of the provided credentials, according to the specified salt and hash iterations. */ protected Hash hashProvidedCredentials(Object credentials, Object salt, int hashIterations) { String hashAlgorithmName = assertHashAlgorithmName(); return new SimpleHash(hashAlgorithmName, credentials, salt, hashIterations); }
/** * Returns a new, <em>uninitialized</em> instance, without its byte array set. Used as a utility method in the * {@link SimpleCredentialsMatcher#getCredentials(org.apache.shiro.authc.AuthenticationInfo) getCredentials(AuthenticationInfo)} implementation. * * @return a new, <em>uninitialized</em> instance, without its byte array set. */ protected AbstractHash newHashInstance() { String hashAlgorithmName = assertHashAlgorithmName(); return new SimpleHash(hashAlgorithmName); }
/** * Hashes the provided credentials a total of {@code hashIterations} times, using the given salt. The hash * implementation/algorithm used is based on the {@link #getHashAlgorithmName() hashAlgorithmName} property. * * @param credentials the submitted authentication token's credentials to hash * @param salt the value to salt the hash, or {@code null} if a salt will not be used. * @param hashIterations the number of times to hash the credentials. At least one hash will always occur though, * even if this argument is 0 or negative. * @return the hashed value of the provided credentials, according to the specified salt and hash iterations. */ protected Hash hashProvidedCredentials(Object credentials, Object salt, int hashIterations) { String hashAlgorithmName = assertHashAlgorithmName(); return new SimpleHash(hashAlgorithmName, credentials, salt, hashIterations); }