*/
@Override
public String getSaltedHash(String password) throws SaltedHashException {
try {
byte[] salt = new byte[saltByteLength];
PortalContainer container = PortalContainer.getInstance();
SecureRandom random = ((SecureRandomService) container.getComponentInstanceOfType(SecureRandomService.class)).getSecureRandom();
random.nextBytes(salt);
SaltedHash saltedHash = new SaltedHash(algorithm, iterationCount, salt, hash(this.algorithm, password, salt,
iterationCount, hashByteLength));
return codec.encode(saltedHash);
} catch (InvalidKeySpecException e) {