de.flexiprovider.core.misty1
Class Misty1KeyGenerator

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

public class Misty1KeyGenerator
extends SecretKeyGenerator

This class generates new keys for the Misty1 block cipher. The Misty1 key size is 128 bits.

Author:
Paul Nguentcheu

Field Summary
static int MISTY1_KEY_SIZE
          The Misty1 key size (16 bytes)
 
Constructor Summary
Misty1KeyGenerator()
           
 
Method Summary
 SecretKey generateKey()
          Generate a Misty1 key.
 void init(AlgorithmParameterSpec params, SecureRandom random)
          Since Misty1 keys are of a fixed size and do not require any parameters, this method only sets the source of randomness.
 void init(int strength, SecureRandom random)
          Since Misty1 keys are of a fixed size, this method only sets the source of randomness.
 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

MISTY1_KEY_SIZE

public static final int MISTY1_KEY_SIZE
The Misty1 key size (16 bytes)
Constructor Detail

Misty1KeyGenerator

public Misty1KeyGenerator()
Method Detail

init

public void init(AlgorithmParameterSpec params,
                 SecureRandom random)
Since Misty1 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 strength,
                 SecureRandom random)
Since Misty1 keys are of a fixed size, this method only sets the source of randomness.
Overrides:
init in class SecretKeyGenerator
Parameters:
strength - the key strength (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 a Misty1 key.
Overrides:
generateKey in class SecretKeyGenerator
Returns:
the generated Misty1Key