de.flexiprovider.core.rc2
Class RC2KeyGenerator

java.lang.Object
  |
  +--javax.crypto.KeyGeneratorSpi
        |
        +--de.flexiprovider.api.keys.SecretKeyGenerator
              |
              +--de.flexiprovider.core.rc2.interfaces.RC2KeyGenerator
                    |
                    +--de.flexiprovider.core.rc2.RC2KeyGenerator

public class RC2KeyGenerator
extends RC2KeyGenerator

This class generates new keys for the RC2 block cipher. The default key size is 64 bits.

Author:
Oliver Seiler

Constructor Summary
RC2KeyGenerator()
           
 
Method Summary
 SecretKey generateKey()
          Generate an RC2 key.
 void init(AlgorithmParameterSpec params, SecureRandom random)
          Initialize the key generator with the given parameters and source of randomness.
 void init(int keySize, SecureRandom random)
          Initialize this key generator with the given key size and source of randomness.
 void init(SecureRandom random)
          Initialize the key generator with the given source of randomness.
 
Methods inherited from class de.flexiprovider.core.rc2.interfaces.RC2KeyGenerator
engineInit
 
Methods inherited from class de.flexiprovider.api.keys.SecretKeyGenerator
engineGenerateKey, 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

RC2KeyGenerator

public RC2KeyGenerator()
Method Detail

init

public void init(AlgorithmParameterSpec params,
                 SecureRandom random)
          throws InvalidAlgorithmParameterException
Initialize the key generator with the given parameters and 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 given parameters are null or not an instance of RC2KeyGenParameterSpec.

init

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

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 RC2 key.
Overrides:
generateKey in class SecretKeyGenerator
Returns:
the generated RC2Key