public class PBKDF2 extends Object
MacAlgorithm
and AESKeyStrength
for the operation specification.Constructor and Description |
---|
PBKDF2(MacAlgorithm macAlgorithm,
AESKeyStrength keyStrength,
String encoding)
Create an instance with the given
MacAlgorithm , AESKeyStrength and encoding. |
Modifier and Type | Method and Description |
---|---|
byte[] |
generateDerivedKey(String password,
byte[] salt,
int iterationCount)
Generate the derived PBKDF2 key using the password, salt and iteration count.
|
public PBKDF2(MacAlgorithm macAlgorithm, AESKeyStrength keyStrength, String encoding) throws NoSuchAlgorithmException
MacAlgorithm
, AESKeyStrength
and encoding.macAlgorithm
- the name of the MAC algorithm to usekeyStrength
- the key strength for determining the key size in bytesencoding
- the encoding to useNoSuchAlgorithmException
- thrown if the MAC algorithm is not supportedpublic byte[] generateDerivedKey(String password, byte[] salt, int iterationCount) throws InvalidKeyException, UnsupportedEncodingException
MacAlgorithm
, AESKeyStrength
and encoding as operational parameterspassword
- the passwordsalt
- the saltiterationCount
- the iteration countInvalidKeyException
- thrown if an error occurred while deriving the keyUnsupportedEncodingException
- thrown if the provided encoding is not supportedCopyright © 2021. All rights reserved.