JXTA

jxta.security.mac
Interface MAC


public interface MAC
extends Description


Field Summary
static byte ALG_NULL
           
static byte ALG_RC4_MD5
           
static byte ALG_RC4_SHA1
           
static byte MODE_ENCRYPT
           
static byte MODE_VERIFY
           
static java.lang.String name
           
 
Method Summary
 int encrypt(byte[] inbuff, int offset, int inLength, byte[] macBuff, int macOffset)
          Encrypts the digest after updating the last buffer of data (may be the only buffer)
 byte getAlgorithm()
          return algorithm type value
 java.lang.String getAlgorithmName()
          return algorithm name as a String
 int getLength()
          get the length of the MAC
 void init(byte theMode, Key theKey, byte[] privateKey)
          initialize the MAC object behaviour
 void update(byte[] inbuf, int offset, int length)
          updates data to be encrypted.
 boolean verify(byte[] inBuff, int inOffset, int inLength, byte[] macBuff, int macOffset, int macLength)
          Verifies a MAC for last/only inBuff against the signature in sigBuff.
 
Methods inherited from interface jxta.security.util.Description
clearDebug, setDebug
 

Field Detail

name

public static final java.lang.String name

ALG_NULL

public static final byte ALG_NULL

ALG_RC4_SHA1

public static final byte ALG_RC4_SHA1

ALG_RC4_MD5

public static final byte ALG_RC4_MD5

MODE_ENCRYPT

public static final byte MODE_ENCRYPT

MODE_VERIFY

public static final byte MODE_VERIFY
Method Detail

getAlgorithmName

public java.lang.String getAlgorithmName()
return algorithm name as a String
Specified by:
getAlgorithmName in interface Description

getAlgorithm

public byte getAlgorithm()
return algorithm type value

getLength

public int getLength()
get the length of the MAC

init

public void init(byte theMode,
                 Key theKey,
                 byte[] privateKey)
          throws CryptoException
initialize the MAC object behaviour

update

public void update(byte[] inbuf,
                   int offset,
                   int length)
            throws CryptoException
updates data to be encrypted.

encrypt

public int encrypt(byte[] inbuff,
                   int offset,
                   int inLength,
                   byte[] macBuff,
                   int macOffset)
            throws CryptoException
Encrypts the digest after updating the last buffer of data (may be the only buffer)

verify

public boolean verify(byte[] inBuff,
                      int inOffset,
                      int inLength,
                      byte[] macBuff,
                      int macOffset,
                      int macLength)
               throws CryptoException
Verifies a MAC for last/only inBuff against the signature in sigBuff. One can use update as with encrypt().

JXTA