de.flexiprovider.core.camellia
Class CamelliaKeyGenerator

java.lang.Object
  |
  +--javax.crypto.KeyGeneratorSpi
        |
        +--de.flexiprovider.api.keys.SecretKeyGenerator
              |
              +--de.flexiprovider.core.camellia.CamelliaKeyGenerator

public class CamelliaKeyGenerator
extends SecretKeyGenerator

This class is used to generate keys for the Camellia block cipher. Values for the key size are 128, 192, and 256 bits, with the default being 128 bits.

Author:
Ralf-Philipp Weinmann

Constructor Summary
CamelliaKeyGenerator()
           
 
Method Summary
 SecretKey generateKey()
          Generate a Camellia key.
 void init(AlgorithmParameterSpec params, SecureRandom random)
          Initialize the key generator with the given parameters (which have to be an instance of CamelliaKeyGenParameterSpec) and a source of randomness.
 void init(int keySize, SecureRandom random)
          Initialize the key generator with the given key size and source of randomness.
 void init(SecureRandom random)
          Initialize the key generator with the default parameters and the given source of randomness.
 
Methods inherited from class de.flexiprovider.api.keys.SecretKeyGenerator
engineGenerateKey, engineInit, engineInit, engineInit, init, init, init
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CamelliaKeyGenerator

public CamelliaKeyGenerator()
Method Detail

init

public void init(AlgorithmParameterSpec params,
                 SecureRandom random)
          throws InvalidAlgorithmParameterException
Initialize the key generator with the given parameters (which have to be an instance of CamelliaKeyGenParameterSpec) and a source of randomness. If the parameters are null, the default parameters are used.
Overrides:
init in class SecretKeyGenerator
Parameters:
params - the parameters
random - the source of randomness
Throws:
InvalidAlgorithmParameterException - if the parameters are not an instance of CamelliaKeyGenParameterSpec.

init

public void init(int keySize,
                 SecureRandom random)
Initialize the key generator with the given key size and source of randomness.
Overrides:
init in class SecretKeyGenerator
Parameters:
keySize - the key size
random - the source of randomness

init

public void init(SecureRandom random)
Initialize the key generator with the default parameters and the given source of randomness.
Overrides:
init in class SecretKeyGenerator
Parameters:
random - the source of randomness

generateKey

public SecretKey generateKey()
Generate a Camellia key.
Overrides:
generateKey in class SecretKeyGenerator
Returns:
the generated CamelliaKey