public static final class MacKeyGenerator.MacKeyGeneratorSha512
extends javax.crypto.KeyGeneratorSpi
Constructor and Description |
---|
MacKeyGenerator.MacKeyGeneratorSha512()
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 MacKeyGenerator.MacKeyGeneratorSha512()
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