2 * Copyright © 2018 Inocybe Technologies and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.aaa.impl.password.service;
10 import org.opendaylight.aaa.api.password.service.PasswordHash;
12 public final class PasswordHashImpl implements PasswordHash {
14 private final String algorithmName;
15 private final String salt;
16 private final int iterations;
17 private final String hashedPassword;
19 private PasswordHashImpl(final String algorithmName, final String salt, final int iterations,
20 final String hashedPassword) {
22 this.algorithmName = algorithmName;
24 this.iterations = iterations;
25 this.hashedPassword = hashedPassword;
28 public static PasswordHash create(final String algorithmName, final String salt, final int iterations,
29 final String hashedPassword) {
31 return new PasswordHashImpl(algorithmName, salt, iterations, hashedPassword);
34 public String getAlgorithmName() {
35 return this.algorithmName;
38 public String getSalt() {
42 public int getIterations() {
43 return this.iterations;
46 public String getHashedPassword() {
47 return this.hashedPassword;