public class PBEKeyGenParams
extends java.lang.Object
implements java.security.spec.AlgorithmParameterSpec, java.security.spec.KeySpec
Constructor and Description |
---|
PBEKeyGenParams(char[] pass,
byte[] salt,
int iterations)
Creates PBE parameters using default encryption algorithm
(DES3_EDE3_CBC).
|
PBEKeyGenParams(char[] pass,
byte[] salt,
int iterations,
EncryptionAlgorithm encAlg)
Creates PBE parameters using default encryption algorithm
(DES3_EDE3_CBC).
|
PBEKeyGenParams(Password pass,
byte[] salt,
int iterations)
Creates PBE parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the password.
|
protected void |
finalize()
Deprecated.
finalize() in Object has been deprecated
|
EncryptionAlgorithm |
getEncryptionAlgorithm()
The encryption algorithm is used with SOME PBE algorithms for
determining the KDF output length.
|
int |
getIterations()
Returns the iteration count.
|
Password |
getPassword()
Returns a reference to the password, not a copy.
|
byte[] |
getSalt()
Returns a reference to the salt.
|
public PBEKeyGenParams(Password pass, byte[] salt, int iterations)
pass
- The password. It will be cloned, so the
caller is still responsible for clearing it. It must not be null.salt
- The salt for the PBE algorithm. Will not be cloned.
Must not be null. It is the responsibility of the caller to
use the right salt length for the algorithm. Most algorithms
use 8 bytes of salt.iterations
- The iteration count for the PBE algorithm.public PBEKeyGenParams(char[] pass, byte[] salt, int iterations)
pass
- The password. It will be cloned, so the
caller is still responsible for clearing it. It must not be null.salt
- The salt for the PBE algorithm. Will not be cloned.
Must not be null. It is the responsibility of the caller to
use the right salt length for the algorithm. Most algorithms
use 8 bytes of salt.iterations
- The iteration count for the PBE algorithm.public PBEKeyGenParams(char[] pass, byte[] salt, int iterations, EncryptionAlgorithm encAlg)
pass
- The password. It will be cloned, so the
caller is still responsible for clearing it. It must not be null.salt
- The salt for the PBE algorithm. Will not be cloned.
Must not be null. It is the responsibility of the caller to
use the right salt length for the algorithm. Most algorithms
use 8 bytes of salt.iterations
- The iteration count for the PBE algorithm.encAlg
- The encryption algorithm. This is used with SOME
PBE algorithms for determining the KDF output length.public Password getPassword()
public byte[] getSalt()
public int getIterations()
public EncryptionAlgorithm getEncryptionAlgorithm()
public void clear()
@Deprecated protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable