Cumulus4j API
(1.1.1)

org.cumulus4j.crypto
Interface MACCalculator

All Superinterfaces:
Mac
All Known Implementing Classes:
MACCalculatorImpl

public interface MACCalculator
extends Mac

A MACCalculator calculates message authentication codes.

Use CryptoRegistry.createMACCalculator(String, boolean) to obtain a MACCalculator instance.

Important: MACCalculators are not thread-safe!

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

Method Summary
 byte[] doFinal(byte[] in)
          Convenience method to process the complete input byte array at once.
 int getIVSize()
          Get the required size of the IV (in bytes).
 int getKeySize()
          Get the required size of the key (in bytes).
 CipherParameters getParameters()
           
 void setAlgorithmName(String algorithmName)
           
 
Methods inherited from interface org.bouncycastle.crypto.Mac
doFinal, getAlgorithmName, getMacSize, init, reset, update, update
 

Method Detail

setAlgorithmName

void setAlgorithmName(String algorithmName)

getParameters

CipherParameters getParameters()

getKeySize

int getKeySize()
Get the required size of the key (in bytes).

Returns:
the required size of the key (in bytes).

getIVSize

int getIVSize()
Get the required size of the IV (in bytes). If a MAC supports multiple sizes, this is the optimal (most secure) IV size. If a MAC supports no IV, this is 0.

Returns:
the required size of the IV.

doFinal

byte[] doFinal(byte[] in)
               throws IllegalStateException
Convenience method to process the complete input byte array at once.

Parameters:
in - the input to calculate a MAC for.
Returns:
the MAC.
Throws:
IllegalStateException - if the MACCalculator isn't initialised.

Cumulus4j API
(1.1.1)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.