JXTA

jxta.security.impl.mac
Class NullMAC

java.lang.Object
  |
  +--jxta.security.impl.mac.NullMAC

public class NullMAC
extends java.lang.Object
implements jxta.security.mac.MAC


Fields inherited from interface jxta.security.mac.MAC
ALG_NULL, ALG_RC4_MD5, ALG_RC4_SHA1, MODE_ENCRYPT, MODE_VERIFY, name
 
Constructor Summary
NullMAC()
          // constructor
 
Method Summary
 void clearDebug()
          turn off debugging
 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()
          // Algorithm name
 int getLength()
          get the length of the MAC
 void init(byte theMode, jxta.security.cipher.Key theKey, byte[] privateKey)
          initialize the MAC object behaviour
 void setDebug()
          turn on debugging
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullMAC

public NullMAC()
// constructor
Method Detail

getAlgorithmName

public java.lang.String getAlgorithmName()
// Algorithm name
Specified by:
getAlgorithmName in interface jxta.security.mac.MAC

setDebug

public void setDebug()
turn on debugging

clearDebug

public void clearDebug()
turn off debugging

getAlgorithm

public byte getAlgorithm()
return algorithm type value
Specified by:
getAlgorithm in interface jxta.security.mac.MAC

getLength

public int getLength()
get the length of the MAC
Specified by:
getLength in interface jxta.security.mac.MAC

init

public void init(byte theMode,
                 jxta.security.cipher.Key theKey,
                 byte[] privateKey)
          throws jxta.security.exceptions.CryptoException
initialize the MAC object behaviour
Specified by:
init in interface jxta.security.mac.MAC

update

public void update(byte[] inbuf,
                   int offset,
                   int length)
            throws jxta.security.exceptions.CryptoException
updates data to be encrypted.
Specified by:
update in interface jxta.security.mac.MAC

encrypt

public int encrypt(byte[] inbuff,
                   int offset,
                   int inLength,
                   byte[] macBuff,
                   int macOffset)
            throws jxta.security.exceptions.CryptoException
Encrypts the digest after updating the last buffer of data (may be the only buffer)
Specified by:
encrypt in interface jxta.security.mac.MAC

verify

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

JXTA