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); }
ScramDigestPasswordImpl(final String algorithm, final char[] password, final SaltedPasswordAlgorithmSpec spec) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException { this(algorithm, password, spec.getSalt(), DEFAULT_ITERATION_COUNT); }
UnixDESCryptPasswordImpl(final char[] passwordChars, SaltedPasswordAlgorithmSpec algorithmSpec) throws InvalidParameterSpecException, InvalidKeyException { this(algorithmSpec.getSalt(), passwordChars); }
protected SaltedPasswordAlgorithmSpec engineDecode(final ASN1Decoder decoder) { final byte[] salt = decoder.decodeOctetString(); return new SaltedPasswordAlgorithmSpec(salt); } }
UnixSHACryptPasswordImpl(final String algorithm, final SaltedPasswordAlgorithmSpec parameterSpec, final char[] password) throws NoSuchAlgorithmException { this(algorithm, truncatedClone(parameterSpec.getSalt()), DEFAULT_ITERATION_COUNT, password); }
default SaltedPasswordAlgorithmSpec getParameterSpec() { return new SaltedPasswordAlgorithmSpec(getSalt()); }
UnixMD5CryptPasswordImpl(final char[] password, final SaltedPasswordAlgorithmSpec spec) throws NoSuchAlgorithmException { this(password, truncatedClone(spec.getSalt())); }
default SaltedPasswordAlgorithmSpec getParameterSpec() { return new SaltedPasswordAlgorithmSpec(getSalt()); }
SunUnixMD5CryptPasswordImpl(final String algorithm, final char[] password, final SaltedPasswordAlgorithmSpec spec) throws NoSuchAlgorithmException { this(algorithm, password, spec.getSalt().clone(), DEFAULT_ITERATION_COUNT); }
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); }
SaltedSimpleDigestPasswordImpl(final String algorithm, final char[] password, final SaltedPasswordAlgorithmSpec spec) throws InvalidKeySpecException { this(algorithm, spec.getSalt().clone(), password); }
protected SaltedPasswordAlgorithmSpec engineDecode(final ASN1Decoder decoder) { final byte[] salt = decoder.decodeOctetString(); return new SaltedPasswordAlgorithmSpec(salt); } }
MaskedPasswordImpl(final String algorithm, final char[] clearPassword, final SaltedPasswordAlgorithmSpec parameterSpec) throws InvalidKeySpecException { this(algorithm, DEFAULT_PBE_KEY, DEFAULT_ITERATION_COUNT, parameterSpec.getSalt().clone(), clearPassword); }
protected SaltedPasswordAlgorithmSpec engineDecode(final ASN1Decoder decoder) { final byte[] salt = decoder.decodeOctetString(); return new SaltedPasswordAlgorithmSpec(salt); } }
protected void engineEncode(final ASN1Encoder encoder, final SaltedPasswordAlgorithmSpec parameterSpec) { encoder.encodeOctetString(parameterSpec.getSalt()); }
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); }
BSDUnixDESCryptPasswordImpl(final char[] password, final SaltedPasswordAlgorithmSpec spec) throws InvalidKeySpecException, InvalidParameterSpecException { this(password, getSaltValue(spec.getSalt()), DEFAULT_ITERATION_COUNT); }
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); }
BCryptPasswordImpl(final char[] password, final SaltedPasswordAlgorithmSpec spec) throws InvalidKeySpecException { this.salt = spec.getSalt().clone(); this.iterationCount = DEFAULT_ITERATION_COUNT; this.hash = bcrypt(this.iterationCount, this.salt, getNormalizedPasswordBytes(password)); }
protected SaltedPasswordAlgorithmSpec engineDecode(final ASN1Decoder decoder) { final byte[] salt = decoder.decodeOctetString(); return new SaltedPasswordAlgorithmSpec(salt); } }