@Override <S extends KeySpec> S getKeySpec(Class<S> keySpecType) throws InvalidKeySpecException { if (keySpecType.isAssignableFrom(IteratedSaltedHashPasswordSpec.class)) { return keySpecType.cast(new IteratedSaltedHashPasswordSpec(this.getHash(), this.getSalt(), this.getIterationCount())); } else { throw log.invalidKeySpecExpectedSpecGotSpec(IteratedSaltedHashPasswordSpec.class.getName(), keySpecType.getName()); } }
BSDUnixDESCryptPasswordImpl(final IteratedSaltedHashPasswordSpec passwordSpec) throws InvalidKeySpecException, InvalidParameterSpecException { this(getSaltValue(passwordSpec.getSalt()), passwordSpec.getIterationCount(), passwordSpec.getHash()); }
BCryptPasswordImpl(final IteratedSaltedHashPasswordSpec passwordSpec) { this(passwordSpec.getHash().clone(), passwordSpec.getSalt().clone(), passwordSpec.getIterationCount()); }
<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException { if (keySpecType.isAssignableFrom(IteratedSaltedHashPasswordSpec.class)) { return keySpecType.cast(new IteratedSaltedHashPasswordSpec(hash.clone(), getSaltBytes(salt), iterationCount)); } throw new InvalidKeySpecException(); }
ScramDigestPasswordImpl(final String algorithm, final IteratedSaltedHashPasswordSpec spec) { this(algorithm, spec.getHash().clone(), spec.getSalt().clone(), spec.getIterationCount()); }
@Override <S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException { if (keySpecType.isAssignableFrom(IteratedSaltedHashPasswordSpec.class)) { return keySpecType.cast(new IteratedSaltedHashPasswordSpec(getHash(), getSalt(), getIterationCount())); } throw new InvalidKeySpecException(); }
SunUnixMD5CryptPasswordImpl(final String algorithm, final IteratedSaltedHashPasswordSpec spec) { this(algorithm, spec.getHash().clone(), spec.getSalt().clone(), spec.getIterationCount()); }
@Override <S extends KeySpec> S getKeySpec(Class<S> keySpecType) throws InvalidKeySpecException { if (keySpecType.isAssignableFrom(IteratedSaltedHashPasswordSpec.class)) { return keySpecType.cast(new IteratedSaltedHashPasswordSpec(this.getHash(), this.getSalt(), this.getIterationCount())); } throw new InvalidKeySpecException(); }
private static byte[] encodeIteratedSaltedHashSpec(IteratedSaltedHashPasswordSpec keySpec) throws InvalidKeySpecException { byte[] salt = keySpec.getSalt(); return new ByteStringBuilder().append(ITERATED_SALTED_HASH_SPEC_ID) .appendPackedUnsignedBE(keySpec.getIterationCount()).appendPackedUnsignedBE(salt.length).append(salt).append(keySpec.getHash()).toArray(); }
@Override <S extends KeySpec> S getKeySpec(Class<S> keySpecType) throws InvalidKeySpecException { if (keySpecType.isAssignableFrom(IteratedSaltedHashPasswordSpec.class)) { return keySpecType.cast(new IteratedSaltedHashPasswordSpec(this.getDigest(), this.getSalt(), this.getIterationCount())); } throw new InvalidKeySpecException(); }
IteratedSaltedHashPasswordSpec passwordSpec = passwordFactory.getKeySpec(passwordFactory.translate(password), IteratedSaltedHashPasswordSpec.class); encoder.startSequence(); encoder.encodeOctetString(passwordSpec.getHash()); encoder.encodeOctetString(passwordSpec.getSalt()); encoder.encodeInteger(passwordSpec.getIterationCount()); encoder.endSequence(); break;
private static PasswordSpec decodeIteratedSaltedHashPasswordSpec(ByteIterator iterator) { int iterationCount = iterator.getPackedBE32(); byte[] salt = iterator.drain(iterator.getPackedBE32()); byte[] hash = iterator.drain(); return new IteratedSaltedHashPasswordSpec(hash, salt, iterationCount); }
BSDUnixDESCryptPasswordImpl(final IteratedSaltedHashPasswordSpec passwordSpec) throws InvalidKeySpecException, InvalidParameterSpecException { this(getSaltValue(passwordSpec.getSalt()), passwordSpec.getIterationCount(), passwordSpec.getHash()); }
final int iterationCount = decoder.decodeInteger().intValue(); decoder.endSequence(); passwordSpec = new IteratedSaltedHashPasswordSpec(hash, salt, iterationCount); break;
BSDUnixDESCryptPasswordImpl(final IteratedSaltedHashPasswordSpec passwordSpec) throws InvalidKeySpecException, InvalidParameterSpecException { this(getSaltValue(passwordSpec.getSalt()), passwordSpec.getIterationCount(), passwordSpec.getHash()); }
if (salt != null) { if (iterationCount > 0) { passwordSpec = new IteratedSaltedHashPasswordSpec(hash, salt, iterationCount); } else { passwordSpec = new SaltedHashPasswordSpec(hash, salt);
BSDUnixDESCryptPasswordImpl(final IteratedSaltedHashPasswordSpec passwordSpec) throws InvalidKeySpecException, InvalidParameterSpecException { this(getSaltValue(passwordSpec.getSalt()), passwordSpec.getIterationCount(), passwordSpec.getHash()); }
@Override <S extends KeySpec> S getKeySpec(Class<S> keySpecType) throws InvalidKeySpecException { if (keySpecType.isAssignableFrom(IteratedSaltedHashPasswordSpec.class)) { return keySpecType.cast(new IteratedSaltedHashPasswordSpec(this.getHash(), this.getSalt(), this.getIterationCount())); } else { throw log.invalidKeySpecExpectedSpecGotSpec(IteratedSaltedHashPasswordSpec.class.getName(), keySpecType.getName()); } }
BCryptPasswordImpl(final IteratedSaltedHashPasswordSpec passwordSpec) { this(passwordSpec.getHash().clone(), passwordSpec.getSalt().clone(), passwordSpec.getIterationCount()); }
@Override <S extends KeySpec> S getKeySpec(Class<S> keySpecType) throws InvalidKeySpecException { if (keySpecType.isAssignableFrom(IteratedSaltedHashPasswordSpec.class)) { return keySpecType.cast(new IteratedSaltedHashPasswordSpec(this.getHash(), this.getSalt(), this.getIterationCount())); } else { throw log.invalidKeySpecExpectedSpecGotSpec(IteratedSaltedHashPasswordSpec.class.getName(), keySpecType.getName()); } }