net.ninthtest.crypto.provider.helix
Class HelixKeyGenerator

java.lang.Object
  extended by javax.crypto.KeyGeneratorSpi
      extended by net.ninthtest.crypto.provider.helix.HelixKeyGenerator

public final class HelixKeyGenerator
extends KeyGeneratorSpi

This class generates secret (symmetric) keys for the Helix combined stream cipher and MAC function algorithm.

Version:
1.0
Author:
Matthew Zipay (mattz@ninthtest.info)

Constructor Summary
HelixKeyGenerator()
          Creates a new HelixKeyGenerator using the default key size and the platform default SecureRandom implementation.
 
Method Summary
protected  SecretKey engineGenerateKey()
          Generates a secret key.
protected  void engineInit(AlgorithmParameterSpec params, SecureRandom random)
          Initializes the key generator with the specified parameter set and a user-provided source of randomness.
protected  void engineInit(int keySize, SecureRandom random)
          Initializes this key generator for a certain keysize, using the given source of randomness.
protected  void engineInit(SecureRandom random)
          Initializes the key generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelixKeyGenerator

public HelixKeyGenerator()
Creates a new HelixKeyGenerator using the default key size and the platform default SecureRandom implementation.

This constructor also performs the provider self-integrity check.

Method Detail

engineInit

protected void engineInit(SecureRandom random)
Initializes the key generator.

Specified by:
engineInit in class KeyGeneratorSpi
Parameters:
random - the source of randomness for this generator
See Also:
KeyGeneratorSpi.engineInit(java.security.SecureRandom)

engineInit

protected void engineInit(int keySize,
                          SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.

Specified by:
engineInit in class KeyGeneratorSpi
Parameters:
keySize - the size of the keys that this generator should generate, specified in number of bits (must be a multiple of eight)
random - the source of randomness for this generator
See Also:
KeyGeneratorSpi.engineInit(int, java.security.SecureRandom)

engineInit

protected void engineInit(AlgorithmParameterSpec params,
                          SecureRandom random)
                   throws InvalidAlgorithmParameterException
Initializes the key generator with the specified parameter set and a user-provided source of randomness.

The Helix key generator does not accept parameters; this method will throw an exception.

Specified by:
engineInit in class KeyGeneratorSpi
Parameters:
params - the key generation parameters
random - the source of randomness for this generator
Throws:
InvalidAlgorithmParameterException - if params is inappropriate for this key generator
See Also:
KeyGeneratorSpi.engineInit(java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom)

engineGenerateKey

protected SecretKey engineGenerateKey()
Generates a secret key.

Specified by:
engineGenerateKey in class KeyGeneratorSpi
Returns:
a new, randomly-generated Helix secret key
See Also:
KeyGeneratorSpi.engineGenerateKey()


Copyright © 2010-2014 Matthew Zipay. All Rights Reserved.