public class IvGenerator
extends javax.crypto.KeyGeneratorSpi
Modifier and Type | Class and Description |
---|---|
static class |
IvGenerator.IvGeneratorSha224
KeyMaterialGenerator for deriving a PKCS#12 IV from a password,
a salt and an iteration count, using SHA-224 as hash function.
|
static class |
IvGenerator.IvGeneratorSha256
KeyMaterialGenerator for deriving a PKCS#12 IV from a password,
a salt and an iteration count, using SHA-256 as hash function.
|
static class |
IvGenerator.IvGeneratorSha384
KeyMaterialGenerator for deriving a PKCS#12 IV from a password,
a salt and an iteration count, using SHA-384 as hash function.
|
static class |
IvGenerator.IvGeneratorSha512
KeyMaterialGenerator for deriving a PKCS#12 IV from a password,
a salt and an iteration count, using SHA-512 as hash function.
|
static class |
IvGenerator.IvGeneratorSha512_224
KeyMaterialGenerator for deriving a PKCS#12 IV from a password,
a salt and an iteration count, using SHA-512/224 as hash function.
|
static class |
IvGenerator.IvGeneratorSha512_256
KeyMaterialGenerator for deriving a PKCS#12 IV from a password,
a salt and an iteration count, using SHA-512/256 as hash function.
|
Constructor and Description |
---|
IvGenerator()
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected javax.crypto.SecretKey |
engineGenerateKey()
Generates the desired key material and returns it as a SecretKey.
|
protected void |
engineInit(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Inits this KeyMaterialGenerator.
|
protected void |
engineInit(int keylen,
java.security.SecureRandom random)
Sets the length of the key to generate.
|
protected void |
engineInit(java.security.SecureRandom random)
Not implemented.
|
public IvGenerator()
protected void engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
engineInit
in class javax.crypto.KeyGeneratorSpi
params
- the required parameters as PBEKeyAndParameterSpecrandom
- not needed by this key generatorjava.security.InvalidAlgorithmParameterException
protected void engineInit(int keylen, java.security.SecureRandom random)
engineInit
in class javax.crypto.KeyGeneratorSpi
protected void engineInit(java.security.SecureRandom random)
engineInit
in class javax.crypto.KeyGeneratorSpi
protected javax.crypto.SecretKey engineGenerateKey()
String algorithm = ...; KeyGenerator keyGen = KeyGenerator.getInstance("PKCS#12", "IAIK"); ... iaik.security.cipher.SecretKey secretKey = (iaik.security.cipher.SecretKey)keyGen.generateKey(); secretKey.setAlgorithm(algorithm);
engineGenerateKey
in class javax.crypto.KeyGeneratorSpi