net.larsan.urd.util
Class HMAC

java.lang.Object
  |
  +--net.larsan.urd.util.HMAC

public class HMAC
extends java.lang.Object

A simple HMAC (rfc 2104) fro the Urd package. This HMAC prepares the key and should prove to be fairly fast in repeated use.

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson

Constructor Summary
HMAC(java.lang.String digest, int blockSize, byte[] key)
          Create a new HMAC.
 
Method Summary
 byte[] digest(byte[] bytes)
          Get digest.
 byte[] digest(byte[] bytes, int off, int len)
          Get digest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HMAC

public HMAC(java.lang.String digest,
            int blockSize,
            byte[] key)
     throws java.security.NoSuchAlgorithmException
Create a new HMAC.

Parameters:
digest - MAC digest to use, e.g. MD5 or SHA-1
blockSize - Digest algorithm block size
key - HMAC key
Method Detail

digest

public byte[] digest(byte[] bytes)
Get digest.


digest

public byte[] digest(byte[] bytes,
                     int off,
                     int len)
Get digest.