Cumulus4j API
(1.0.0)

org.cumulus4j.crypto
Class AbstractMACCalculatorFactory

java.lang.Object
  extended by org.cumulus4j.crypto.AbstractMACCalculatorFactory
All Implemented Interfaces:
MACCalculatorFactory
Direct Known Subclasses:
MACCalculatorFactoryImpl

public abstract class AbstractMACCalculatorFactory
extends Object
implements MACCalculatorFactory

Abstract base class for implementing a MACCalculatorFactory.

Implementors should subclass this class instead of directly implementing the interface MACCalculatorFactory.

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

Constructor Summary
AbstractMACCalculatorFactory()
           
 
Method Summary
protected abstract  MACCalculator _createMACCalculator()
           
 MACCalculator createMACCalculator(boolean initWithDefaults)
           Create a new instance of MACCalculator and optionally initialise it.
 String getAlgorithmName()
          Get the name of the MAC algorithm implemented by the MACCalculator created by this factory.
 void setAlgorithmName(String algorithmName)
          Set the name of the MAC algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMACCalculatorFactory

public AbstractMACCalculatorFactory()
Method Detail

getAlgorithmName

public String getAlgorithmName()
Description copied from interface: MACCalculatorFactory
Get the name of the MAC algorithm implemented by the MACCalculator created by this factory. See Supported algorithms for a list of supported algorithms.

Specified by:
getAlgorithmName in interface MACCalculatorFactory
Returns:
the name of the MAC algorithm.

setAlgorithmName

public void setAlgorithmName(String algorithmName)
Description copied from interface: MACCalculatorFactory
Set the name of the MAC algorithm. This method is called once and should throw an IllegalStateException if it is called again.

Specified by:
setAlgorithmName in interface MACCalculatorFactory
Parameters:
algorithmName - the name of the MAC algorithm; never null.
See Also:
MACCalculatorFactory.getAlgorithmName()

createMACCalculator

public MACCalculator createMACCalculator(boolean initWithDefaults)
Description copied from interface: MACCalculatorFactory

Create a new instance of MACCalculator and optionally initialise it.

Specified by:
createMACCalculator in interface MACCalculatorFactory
Parameters:
initWithDefaults - whether to initialise the MACCalculator with default values so that it can be used immediately as-is.
Returns:
a new instance of MACCalculator (iff initWithDefaults==true ready-to-use; otherwise requiring initialisation before it can be used).

_createMACCalculator

protected abstract MACCalculator _createMACCalculator()

Cumulus4j API
(1.0.0)

Copyright © 2012 NightLabs Consulting GmbH. All Rights Reserved.