Package com.mku.salmon.password
Class DefaultPbkdfProvider
java.lang.Object
com.mku.salmon.password.DefaultPbkdfProvider
- All Implemented Interfaces:
IPbkdfProvider
Provides pbkdf functions.
-
Field Summary
Fields inherited from interface com.mku.salmon.password.IPbkdfProvider
PBKDF_SHA256 -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DefaultPbkdfProvider
public DefaultPbkdfProvider()
-
-
Method Details
-
getKey
public byte[] getKey(String password, byte[] salt, int iterations, int outputBytes, PbkdfAlgo pbkdfAlgo) Get a key derived from a text password- Specified by:
getKeyin interfaceIPbkdfProvider- Parameters:
password- The text password.salt- The salt (at least 24 bytes).iterations- Iterations to use. Make sure you use a high number according to your hardware specs.outputBytes- The length of the output key.pbkdfAlgo- The PBKDF algorithm to use- Returns:
- The key.
- Throws:
SecurityException- Thrown if there is a security exception
-