Cumulus4j API
(1.1.0)

org.cumulus4j.crypto.internal.symmetric
Class SecretKeyGeneratorImpl

java.lang.Object
  extended by org.cumulus4j.crypto.internal.symmetric.SecretKeyGeneratorImpl
All Implemented Interfaces:
SecretKeyGenerator

public class SecretKeyGeneratorImpl
extends Object
implements SecretKeyGenerator

Default implementation of SecretKeyGenerator.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Constructor Summary
SecretKeyGeneratorImpl()
           
 
Method Summary
 KeyParameter generateKey()
          Generate random a secret key.
 void init(KeyGenerationParameters params)
          Initialise this SecretKeyGenerator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecretKeyGeneratorImpl

public SecretKeyGeneratorImpl()
Method Detail

init

public void init(KeyGenerationParameters params)
Description copied from interface: SecretKeyGenerator
Initialise this SecretKeyGenerator. Implementations should be able to initialise with defaults, if no parameters are given (i.e. params being null). Usually, defaults mean to generate 256 bit keys.

Specified by:
init in interface SecretKeyGenerator
Parameters:
params - the parameters or null, if defaults should be used.

generateKey

public KeyParameter generateKey()
Description copied from interface: SecretKeyGenerator
Generate random a secret key. Throws an IllegalStateException, if SecretKeyGenerator.init(KeyGenerationParameters) was not yet called.

Specified by:
generateKey in interface SecretKeyGenerator
Returns:
the newly created secret key; never null.

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.