public final class PBKDF2KeyStretcher extends java.lang.Object implements KeyStretchingFunction
This uses SHA1 as the underlying cryptographic hash functions, since SHA256+ are usually not provided by standard JCA providers in Android.
| Constructor and Description |
|---|
PBKDF2KeyStretcher()
Create a new instance with default iteration count (see
PBKDF2_DEFAULT_ITERATIONS |
PBKDF2KeyStretcher(int iterations,
java.security.Provider provider)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
stretch(byte[] salt,
char[] password,
int outLengthByte)
Derives and stretches the given password with given salt to desired out length.
|
public PBKDF2KeyStretcher()
PBKDF2_DEFAULT_ITERATIONSpublic PBKDF2KeyStretcher(int iterations,
java.security.Provider provider)
iterations - computational costprovider - optional security provider (might be null if default should be chosen)public byte[] stretch(byte[] salt,
char[] password,
int outLengthByte)
KeyStretchingFunctionstretch in interface KeyStretchingFunctionsalt - to use when deriving/stretching the passwordpassword - to stretchoutLengthByte - required out length byte