- java.lang.Object
-
- io.helidon.common.crypto.PasswordKeyDerivation
-
public class PasswordKeyDerivation extends Object
Util class used for encryption key derivation from the password.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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 derivationkeySize
- output key size in bitsiterations
- number of iterations used in derivation- 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 derivationkeySize
- output key size in bitsiterations
- number of iterations used in derivation- Returns:
- derived key from the password
-
-