Cumulus4j API
(1.0.0)

org.cumulus4j.crypto
Interface SecretKeyGenerator

All Known Implementing Classes:
SecretKeyGeneratorImpl

public interface SecretKeyGenerator

Generator for secret keys to be used in symmetric encryption.

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

Method Summary
 KeyParameter generateKey()
          Generate random a secret key.
 void init(KeyGenerationParameters params)
          Initialise this SecretKeyGenerator.
 

Method Detail

init

void init(KeyGenerationParameters params)
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.

Parameters:
params - the parameters or null, if defaults should be used.

generateKey

KeyParameter generateKey()
Generate random a secret key. Throws an IllegalStateException, if init(KeyGenerationParameters) was not yet called.

Returns:
the newly created secret key; never null.

Cumulus4j API
(1.0.0)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.