/** * Determine if the given algorithm name is a valid masked password algorithm name. * * @param name the algorithm name * @return {@code true} if the algorithm name is valid for this password type, {@code false} otherwise */ static boolean isMaskedAlgorithm(String name) { return getPBEName(name) != null; }
Object writeReplace() { return DigestPassword.createRaw(algorithm, username, realm, digest); }
Object writeReplace() { return SimpleDigestPassword.createRaw(algorithm, digest); }
OneTimePasswordImpl(final OneTimePassword password) { this(password.getAlgorithm(), password.getHash().clone(), password.getSeed(), password.getSequenceNumber()); }
DigestPasswordImpl(final DigestPassword password) { this(password.getAlgorithm(), password.getUsername(), password.getRealm(), password.getDigest().clone()); }
ScramDigestPasswordImpl(final ScramDigestPassword password) { this(password.getAlgorithm(), password.getDigest().clone(), password.getSalt().clone(), password.getIterationCount()); }
SunUnixMD5CryptPasswordImpl(SunUnixMD5CryptPassword password) { this(password.getAlgorithm(), password.getHash().clone(), password.getSalt().clone(), password.getIterationCount()); }
/** * Create a new configuration which is the same as this configuration, but which uses the given password to authenticate. * * @param password the password to use * @return the new configuration */ public AuthenticationConfiguration usePassword(char[] password) { return usePassword(password == null ? null : ClearPassword.createRaw(ClearPassword.ALGORITHM_CLEAR, password)); }
default IteratedSaltedPasswordAlgorithmSpec getParameterSpec() { final int salt = getSalt(); byte[] saltBytes = new byte[4]; // Big-endian format saltBytes[0] = (byte) (salt >>> 24 & 0xff); saltBytes[1] = (byte) (salt >>> 16 & 0xff); saltBytes[2] = (byte) (salt >>> 8 & 0xff); saltBytes[3] = (byte) (salt & 0xff); return new IteratedSaltedPasswordAlgorithmSpec(getIterationCount(), saltBytes); }
public RawClearPassword clone() { final char[] password = this.password; if (password == null || password.length == 0) { return this; } return new RawClearPassword(getAlgorithm(), password.clone()); }
Object writeReplace() { return SaltedSimpleDigestPassword.createRaw(algorithm, digest, salt); }
default SaltedPasswordAlgorithmSpec getParameterSpec() { final int salt = getSalt(); byte[] saltBytes = new byte[2]; // Big-endian format saltBytes[0] = (byte) (salt >>> 8 & 0xff); saltBytes[1] = (byte) (salt & 0xff); return new SaltedPasswordAlgorithmSpec(saltBytes); }
default SaltedPasswordAlgorithmSpec getParameterSpec() { return new SaltedPasswordAlgorithmSpec(getSalt()); }
Object writeReplace() { return UnixDESCryptPassword.createRaw(getAlgorithm(), salt, hash); }
Object writeReplace() { return UnixSHACryptPassword.createRaw(algorithm, salt, hash, iterationCount); }
Object writeReplace() { return SunUnixMD5CryptPassword.createRaw(algorithm, salt, hash, iterationCount); }
Object writeReplace() { return ScramDigestPassword.createRaw(algorithm, digest, salt, iterationCount); }
Object writeReplace() { return OneTimePassword.createRaw(algorithm, hash, seed, sequenceNumber); }
Object writeReplace() { return BCryptPassword.createRaw(getAlgorithm(), hash, salt, iterationCount); }