/** * Determine whether the given password can be converted to the given key specification type by this factory. * * @param password the password object * @param specType the specification class * @param <T> the specification type * @return {@code true} if the password can be converted, {@code false} otherwise */ public <T extends KeySpec> boolean convertibleToKeySpec(Password password, Class<T> specType) { return spi.engineConvertibleToKeySpec(algorithm, password, specType); }
/** * Generate a new {@link Password} object for the given specification. * * @param keySpec the specification * @return the password object * @throws InvalidKeySpecException if the key specification is not valid for this algorithm */ public Password generatePassword(KeySpec keySpec) throws InvalidKeySpecException { return spi.engineGeneratePassword(algorithm, keySpec); }
/** * Generate a key specification of the given type from the given password object. * * @param password the password object * @param specType the specification class * @param <T> the specification type * @return the key specification * @throws InvalidKeySpecException if the password cannot be translated to the given key specification type */ public <T extends KeySpec> T getKeySpec(Password password, Class<T> specType) throws InvalidKeySpecException { return spi.engineGetKeySpec(algorithm, password, specType); }
/** * Determine whether the given password can be translated into one which is consumable by this factory. If this * method returns {@code true}, then {@link #translate(Password)} will succeed. * * @param password the password object * @return {@code true} if the given password is supported by this algorithm, {@code false} otherwise */ public boolean isTranslatable(Password password) { return spi.engineIsTranslatablePassword(algorithm, password); }
/** * Translate the given password object to one which is consumable by this factory. * * @param password the password object * @return the equivalent password object that this factory can work with * @throws InvalidKeyException if the given password is not supported by this algorithm */ public Password translate(Password password) throws InvalidKeyException { return spi.engineTranslatePassword(algorithm, password); }
/** * Verify a password guess. * * @param password the password object * @param guess the guessed password characters * @return {@code true} if the guess matches the password, {@code false} otherwise * @throws InvalidKeyException if the given password is not supported by this factory */ public boolean verify(Password password, char[] guess) throws InvalidKeyException { return spi.engineVerify(algorithm, password, guess); }
/** * Transform a password with new parameters. Not every transformation is allowed, but iterative password types * generally should allow increasing the number of iterations. * * @param password the password * @param parameterSpec the new parameters * @return the transformed password * @throws InvalidKeyException if the given password is invalid * @throws InvalidAlgorithmParameterException if the transformation cannot be applied to the given parameters */ public Password transform(Password password, AlgorithmParameterSpec parameterSpec) throws InvalidKeyException, InvalidAlgorithmParameterException { return spi.engineTransform(algorithm, password, parameterSpec); } }
/** * Determine whether the given password can be translated into one which is consumable by this factory. If this * method returns {@code true}, then {@link #translate(Password)} will succeed. * * @param password the password object * @return {@code true} if the given password is supported by this algorithm, {@code false} otherwise */ public boolean isTranslatable(Password password) { return spi.engineIsTranslatablePassword(algorithm, password); }
/** * Translate the given password object to one which is consumable by this factory. * * @param password the password object * @return the equivalent password object that this factory can work with * @throws InvalidKeyException if the given password is not supported by this algorithm */ public Password translate(Password password) throws InvalidKeyException { return spi.engineTranslatePassword(algorithm, password); }
/** * Verify a password guess. * * @param password the password object * @param guess the guessed password characters * @return {@code true} if the guess matches the password, {@code false} otherwise * @throws InvalidKeyException if the given password is not supported by this factory */ public boolean verify(Password password, char[] guess) throws InvalidKeyException { return spi.engineVerify(algorithm, password, guess); }
/** * Transform a password with new parameters. Not every transformation is allowed, but iterative password types * generally should allow increasing the number of iterations. * * @param password the password * @param parameterSpec the new parameters * @return the transformed password * @throws InvalidKeyException if the given password is invalid * @throws InvalidAlgorithmParameterException if the transformation cannot be applied to the given parameters */ public Password transform(Password password, AlgorithmParameterSpec parameterSpec) throws InvalidKeyException, InvalidAlgorithmParameterException { return spi.engineTransform(algorithm, password, parameterSpec); } }
/** * Generate a key specification of the given type from the given password object. * * @param password the password object * @param specType the specification class * @param <T> the specification type * @return the key specification * @throws InvalidKeySpecException if the password cannot be translated to the given key specification type */ public <T extends KeySpec> T getKeySpec(Password password, Class<T> specType) throws InvalidKeySpecException { return spi.engineGetKeySpec(algorithm, password, specType); }
/** * Generate a new {@link Password} object for the given specification. * * @param keySpec the specification * @return the password object * @throws InvalidKeySpecException if the key specification is not valid for this algorithm */ public Password generatePassword(KeySpec keySpec) throws InvalidKeySpecException { return spi.engineGeneratePassword(algorithm, keySpec); }
/** * Determine whether the given password can be converted to the given key specification type by this factory. * * @param password the password object * @param specType the specification class * @param <T> the specification type * @return {@code true} if the password can be converted, {@code false} otherwise */ public <T extends KeySpec> boolean convertibleToKeySpec(Password password, Class<T> specType) { return spi.engineConvertibleToKeySpec(algorithm, password, specType); }
/** * Determine whether the given password can be translated into one which is consumable by this factory. If this * method returns {@code true}, then {@link #translate(Password)} will succeed. * * @param password the password object * @return {@code true} if the given password is supported by this algorithm, {@code false} otherwise */ public boolean isTranslatable(Password password) { return spi.engineIsTranslatablePassword(algorithm, password); }
/** * Translate the given password object to one which is consumable by this factory. * * @param password the password object * @return the equivalent password object that this factory can work with * @throws InvalidKeyException if the given password is not supported by this algorithm */ public Password translate(Password password) throws InvalidKeyException { return spi.engineTranslatePassword(algorithm, password); }
/** * Verify a password guess. * * @param password the password object * @param guess the guessed password characters * @return {@code true} if the guess matches the password, {@code false} otherwise * @throws InvalidKeyException if the given password is not supported by this factory */ public boolean verify(Password password, char[] guess) throws InvalidKeyException { return spi.engineVerify(algorithm, password, guess); }
/** * Transform a password with new parameters. Not every transformation is allowed, but iterative password types * generally should allow increasing the number of iterations. * * @param password the password * @param parameterSpec the new parameters * @return the transformed password * @throws InvalidKeyException if the given password is invalid * @throws InvalidAlgorithmParameterException if the transformation cannot be applied to the given parameters */ public Password transform(Password password, AlgorithmParameterSpec parameterSpec) throws InvalidKeyException, InvalidAlgorithmParameterException { return spi.engineTransform(algorithm, password, parameterSpec); } }
/** * Generate a key specification of the given type from the given password object. * * @param password the password object * @param specType the specification class * @param <T> the specification type * @return the key specification * @throws InvalidKeySpecException if the password cannot be translated to the given key specification type */ public <T extends KeySpec> T getKeySpec(Password password, Class<T> specType) throws InvalidKeySpecException { return spi.engineGetKeySpec(algorithm, password, specType); }
/** * Generate a new {@link Password} object for the given specification. * * @param keySpec the specification * @return the password object * @throws InvalidKeySpecException if the key specification is not valid for this algorithm */ public Password generatePassword(KeySpec keySpec) throws InvalidKeySpecException { return spi.engineGeneratePassword(algorithm, keySpec); }