Package com.mku.salmon.password
Class DefaultPbkdfProvider
- java.lang.Object
-
- com.mku.salmon.password.DefaultPbkdfProvider
-
- All Implemented Interfaces:
IPbkdfProvider
public class DefaultPbkdfProvider extends java.lang.Object implements IPbkdfProvider
Provides pbkdf functions.
-
-
Field Summary
-
Fields inherited from interface com.mku.salmon.password.IPbkdfProvider
PBKDF_SHA256
-
-
Constructor Summary
Constructors Constructor Description DefaultPbkdfProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getKey(java.lang.String password, byte[] salt, int iterations, int outputBytes, PbkdfAlgo pbkdfAlgo)
Get a key derived from a text password
-
-
-
Method Detail
-
getKey
public byte[] getKey(java.lang.String password, byte[] salt, int iterations, int outputBytes, PbkdfAlgo pbkdfAlgo)
Get a key derived from a text password- Specified by:
getKey
in 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
-
-