|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.crypto.KeyGeneratorSpi
|
+--iaik.pkcs.pkcs5.PBKDF2
This class implements the KeyGenerator Service Provider
Interface (SPI) for the
password-based-key-derivation-function-2
from the PKCS#5 v2.0
Password-Based Cryptography Standard.
You can get this document from:
RSA Laboratories .
Use this class as you can read here:
KeyGenerator pKCS5_PBKDF2 = null;
try {
pKCS5_PBKDF2 = KeyGenerator.getInstance("PBKDF2", "IAIK");
} catch (Exception e) {
....
}
iaik.security.spec.PBEKeyAndParameterSpec parameterSpec;
parameterSpec = new PBEKeyAndParameterSpec(password,
salt,
iterationCount,
derivedKeyLength);
try {
pKCS5_PBKDF2.init(parameterSpec, null);
} catch (InvalidAlgorithmParameterException e) {
...
}
SecretKey derivedKey;
derivedKey = pKCS5_PBKDF2.generateKey();
KeyGenerator| Constructor Summary | |
PBKDF2()
The default constructor |
|
| Method Summary | |
SecretKey |
engineGenerateKey()
Derives symmetric key. |
void |
engineInit(AlgorithmParameterSpec algorithmParameterSp,
SecureRandom secureRandom)
Initializes the password-based-key-derivation-function |
void |
engineInit(int int1,
SecureRandom secureRandom)
Don't use this method. |
void |
engineInit(SecureRandom secureRandom)
Don't use this method. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public PBKDF2()
| Method Detail |
public SecretKey engineGenerateKey()
public void engineInit(int int1,
SecureRandom secureRandom)
strength - the strength of the key to be createdrandom - the random seedpublic void engineInit(SecureRandom secureRandom)
random - the random seedKeyGenerator.init(java.security.SecureRandom)
public void engineInit(AlgorithmParameterSpec algorithmParameterSp,
SecureRandom secureRandom)
throws InvalidAlgorithmParameterException
algorithmParameterSp - must be an instance of
PBEKeyAndParameterSpecsecureRandom - not needed, should be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||