|
|||||||||
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()
String algorithm = ...; KeyGenerator pbkdf2 = KeyGenerator.getInstance("PBKDF2", "IAIK"); ... iaik.security.cipher.SecretKey secretKey = (iaik.security.cipher.SecretKey)pbkdf2.generateKey(); secretKey.setAlgorithm(algorithm);
engineGenerateKey
in class KeyGeneratorSpi
public void engineInit(int int1, SecureRandom secureRandom)
engineInit
in class KeyGeneratorSpi
javax.crypto.KeyGeneratorSpi
strength
- the strength of the key to be createdrandom
- the random seedpublic void engineInit(SecureRandom secureRandom)
engineInit
in class KeyGeneratorSpi
javax.crypto.KeyGeneratorSpi
random
- the random seedKeyGenerator.init(java.security.SecureRandom)
public void engineInit(AlgorithmParameterSpec algorithmParameterSp, SecureRandom secureRandom) throws InvalidAlgorithmParameterException
engineInit
in class KeyGeneratorSpi
algorithmParameterSp
- must be an instance of
PBEKeyAndParameterSpec
secureRandom
- not needed, should be null
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |