de.flexiprovider.core.idea
Class IDEAKeyGenerator

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

public class IDEAKeyGenerator
extends SecretKeyGenerator

This class is used to generate keys for the IDEA block cipher. The IDEA key size is 128 bits.

Author:
Ralph Kuhnert, Anders Adamson

Field Summary
static int IDEA_KEY_SIZE
          The IDEA key size (16 bytes)
 
Constructor Summary
IDEAKeyGenerator()
           
 
Method Summary
 SecretKey generateKey()
          Generate an IDEA key.
 void init(AlgorithmParameterSpec params, SecureRandom random)
          Initialize the key generator.
 void init(int keySize, SecureRandom random)
          Initialize the key generator.
 void init(SecureRandom random)
          Initialize the key generator with 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
 

Field Detail

IDEA_KEY_SIZE

public static final int IDEA_KEY_SIZE
The IDEA key size (16 bytes)
Constructor Detail

IDEAKeyGenerator

public IDEAKeyGenerator()
Method Detail

init

public void init(AlgorithmParameterSpec params,
                 SecureRandom random)
Initialize the key generator. Since IDEA keys are of a fixed size and do not require any parameters, this method only sets the source of randomness.
Overrides:
init in class SecretKeyGenerator
Parameters:
params - the parameters (not used)
random - the source of randomness

init

public void init(int keySize,
                 SecureRandom random)
Initialize the key generator. Since IDEA keys are of a fixed size, this method only sets the source of randomness.
Overrides:
init in class SecretKeyGenerator
Parameters:
keySize - the key size (not used)
random - the source of randomness for this key generator

init

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

generateKey

public SecretKey generateKey()
Generate an IDEA key.
Overrides:
generateKey in class SecretKeyGenerator
Returns:
the generated IDEAKey