java.lang.Object
io.helidon.common.crypto.PasswordKeyDerivation
Util class used for encryption key derivation from the password.
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]deriveKey(char[] password, byte[] salt, int iterations, int keySize) Derive key from the password with the usage of the salt.static byte[]deriveKey(String algorithm, String provider, char[] password, byte[] salt, int iterations, int keySize) Derive key from the password with the usage of the salt and selected algorithm.
-
Method Details
-
deriveKey
public static byte[] deriveKey(char[] password, byte[] salt, int iterations, int keySize) Derive key from the password with the usage of the salt.
Uses algorithm PBKDF2WithHmacSHA256 for password derivation by default.- Parameters:
password- base for key derivationsalt- salt for key derivationiterations- number of iterations used in derivationkeySize- output key size in bits- Returns:
- derived key from the password
-
deriveKey
public static byte[] deriveKey(String algorithm, String provider, char[] password, byte[] salt, int iterations, int keySize) Derive key from the password with the usage of the salt and selected algorithm.- Parameters:
algorithm- algorithm to be used for derivationprovider- provider of the algorithmpassword- base for key derivationsalt- salt for key derivationiterations- number of iterations used in derivationkeySize- output key size in bits- Returns:
- derived key from the password
-