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); }
UnixDESCryptPasswordImpl(final UnixDESCryptPassword password) throws InvalidKeyException { this(password.getSalt(), password.getHash()); }
private static void composeCryptBasedPassword(ByteArrayOutputStream out, UnixDESCryptPassword password) throws IOException { out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() & 0x3f)); out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() >> 6 & 0x3f)); out.write(ByteIterator.ofBytes(password.getHash()).base64Encode(ModularCrypt.MOD_CRYPT, false).asUtf8().drain()); }
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() { 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() { 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); }
UnixDESCryptPasswordImpl(final UnixDESCryptPassword password) throws InvalidKeyException { this(password.getSalt(), password.getHash()); }
UnixDESCryptPasswordImpl(final UnixDESCryptPassword password) throws InvalidKeyException { this(password.getSalt(), password.getHash()); }
UnixDESCryptPasswordImpl(final UnixDESCryptPassword password) throws InvalidKeyException { this(password.getSalt(), password.getHash()); }
private static void composeCryptBasedPassword(ByteArrayOutputStream out, UnixDESCryptPassword password) throws IOException { out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() & 0x3f)); out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() >> 6 & 0x3f)); out.write(ByteIterator.ofBytes(password.getHash()).base64Encode(ModularCrypt.MOD_CRYPT, false).asUtf8().drain()); }
private static void composeCryptBasedPassword(ByteArrayOutputStream out, UnixDESCryptPassword password) throws IOException { out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() & 0x3f)); out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() >> 6 & 0x3f)); out.write(ByteIterator.ofBytes(password.getHash()).base64Encode(ModularCrypt.MOD_CRYPT, false).asUtf8().drain()); }
private static void composeCryptBasedPassword(ByteArrayOutputStream out, UnixDESCryptPassword password) throws IOException { out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() & 0x3f)); out.write(ModularCrypt.MOD_CRYPT.encode(password.getSalt() >> 6 & 0x3f)); out.write(ByteIterator.ofBytes(password.getHash()).base64Encode(ModularCrypt.MOD_CRYPT, false).asUtf8().drain()); }