/** * Returns the {@link #getHashAlgorithmName() hashAlgorithmName} property, but will throw an * {@link IllegalStateException} if it has not been set. * * @return the required {@link #getHashAlgorithmName() hashAlgorithmName} property * @throws IllegalStateException if the property has not been set prior to calling this method. * @since 1.1 */ private String assertHashAlgorithmName() throws IllegalStateException { String hashAlgorithmName = getHashAlgorithmName(); if (hashAlgorithmName == null) { String msg = "Required 'hashAlgorithmName' property has not been set. This is required to execute " + "the hashing algorithm."; throw new IllegalStateException(msg); } return hashAlgorithmName; }
/** * Returns the {@link #getHashAlgorithmName() hashAlgorithmName} property, but will throw an * {@link IllegalStateException} if it has not been set. * * @return the required {@link #getHashAlgorithmName() hashAlgorithmName} property * @throws IllegalStateException if the property has not been set prior to calling this method. * @since 1.1 */ private String assertHashAlgorithmName() throws IllegalStateException { String hashAlgorithmName = getHashAlgorithmName(); if (hashAlgorithmName == null) { String msg = "Required 'hashAlgorithmName' property has not been set. This is required to execute " + "the hashing algorithm."; throw new IllegalStateException(msg); } return hashAlgorithmName; }
/** * Returns the {@link #getHashAlgorithmName() hashAlgorithmName} property, but will throw an * {@link IllegalStateException} if it has not been set. * * @return the required {@link #getHashAlgorithmName() hashAlgorithmName} property * @throws IllegalStateException if the property has not been set prior to calling this method. * @since 1.1 */ private String assertHashAlgorithmName() throws IllegalStateException { String hashAlgorithmName = getHashAlgorithmName(); if (hashAlgorithmName == null) { String msg = "Required 'hashAlgorithmName' property has not been set. This is required to execute " + "the hashing algorithm."; throw new IllegalStateException(msg); } return hashAlgorithmName; }
@Override public String create(String id, String password) { String algorithm = hashedCredentialsMatcher.getHashAlgorithmName(); int iterations = hashedCredentialsMatcher.getHashIterations(); // String salt = PasswordShiro.salt(id); String salt = null; SimpleHash hash = new SimpleHash(algorithm, password, salt, iterations); return hash.toHex(); }
@Override public String create(String id, String password) { String algorithm = hashedCredentialsMatcher.getHashAlgorithmName(); int iterations = hashedCredentialsMatcher.getHashIterations(); // String salt = PasswordShiro.salt(id); String salt = null; SimpleHash hash = new SimpleHash(algorithm, password, salt, iterations); return hash.toHex(); }