iaik.security.spec
Class PBEKeyAndParameterSpec
java.lang.Object
|
+--iaik.security.spec.PBEKeyAndParameterSpec
- public class PBEKeyAndParameterSpec
- extends java.lang.Object
- implements AlgorithmParameterSpec
This class is simply a combination of PBEParameterSpec and
PBEKeySpec since both specs are needed when generating a
SecretKey for a MAC. Typically a MAC SecretKey depends on
a user specified password, a salt value and an iteration count.
|
Constructor Summary |
PBEKeyAndParameterSpec(byte[] password,
byte[] salt,
int iterationCount,
int derivedKeyLength)
Constructs a parameter set for password-based encryption for
generating MAC secret keys. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
PBEKeyAndParameterSpec
public PBEKeyAndParameterSpec(byte[] password,
byte[] salt,
int iterationCount,
int derivedKeyLength)
- Constructs a parameter set for password-based encryption for
generating MAC secret keys.
Note that the given password and the salt are cloned before
they are stored in the new MACParameterSpec object.
- Parameters:
password - the passwordsalt - the saltiterationCount - the iteration countderivedKeyLength - the length the derived key should have
getIterationCount
public final int getIterationCount()
- Returns the iteration count.
getDerivedKeyLength
public final int getDerivedKeyLength()
- Returns the length the derived key should have.
getSalt
public final byte[] getSalt()
- Returns the salt.
getPassword
public final byte[] getPassword()
- Returns the password.
Note that this method returns a reference to the password.
It is the caller's responsibility to zero out the password
information after it is no longer needed.