client
Class MacGenerator

java.lang.Object
  extended by client.MacGenerator

final class MacGenerator
extends java.lang.Object

Provides methods for generating message authentication codes (MACs) and MAC keys.

Author:
Karl-Peter Fuchs

Method Summary
protected static byte[] generateMAC(java.security.Key key, byte[] message)
          Generates and returns a message authentication code for the bypassed message.
protected static javax.crypto.SecretKey generateMacKey()
          Generates and returns a MAC key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateMacKey

protected static javax.crypto.SecretKey generateMacKey()
Generates and returns a MAC key. Method is thread-safe.

Returns:
The generated MAC key.

generateMAC

protected static byte[] generateMAC(java.security.Key key,
                                    byte[] message)
Generates and returns a message authentication code for the bypassed message. Method is thread-safe.

Parameters:
key - Key to generate message authentication code with.
message - Message to be authenticated.
Returns:
Message authentication code for the bypassed message.