Build 1.0_r1(from source)

javax.crypto
Class Mac

java.lang.Object
  extended by javax.crypto.Mac
All Implemented Interfaces:
Cloneable

public class Mac
extends Object
implements Cloneable


Constructor Summary
protected Mac(MacSpi macSpi, Provider provider, String algorithm)
           
 
Method Summary
 Object clone()
          Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
 byte[] doFinal()
           
 byte[] doFinal(byte[] input)
           
 void doFinal(byte[] output, int outOffset)
           
 String getAlgorithm()
           
static Mac getInstance(String algorithm)
           
static Mac getInstance(String algorithm, Provider provider)
           
static Mac getInstance(String algorithm, String provider)
           
 int getMacLength()
           
 Provider getProvider()
           
 void init(Key key)
           
 void init(Key key, AlgorithmParameterSpec params)
           
 void reset()
           
 void update(byte input)
           
 void update(byte[] input)
           
 void update(byte[] input, int offset, int len)
           
 void update(ByteBuffer input)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mac

protected Mac(MacSpi macSpi,
              Provider provider,
              String algorithm)
Method Detail

getAlgorithm

public final String getAlgorithm()

getProvider

public final Provider getProvider()

getInstance

public static final Mac getInstance(String algorithm)
                             throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

getInstance

public static final Mac getInstance(String algorithm,
                                    String provider)
                             throws NoSuchAlgorithmException,
                                    NoSuchProviderException
Throws:
NoSuchAlgorithmException
NoSuchProviderException

getInstance

public static final Mac getInstance(String algorithm,
                                    Provider provider)
                             throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

getMacLength

public final int getMacLength()

init

public final void init(Key key,
                       AlgorithmParameterSpec params)
                throws InvalidKeyException,
                       InvalidAlgorithmParameterException
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

init

public final void init(Key key)
                throws InvalidKeyException
Throws:
InvalidKeyException

update

public final void update(byte input)
                  throws IllegalStateException
Throws:
IllegalStateException

update

public final void update(byte[] input,
                         int offset,
                         int len)
                  throws IllegalStateException
Throws:
IllegalStateException

update

public final void update(byte[] input)
                  throws IllegalStateException
Throws:
IllegalStateException

update

public final void update(ByteBuffer input)

doFinal

public final byte[] doFinal()
                     throws IllegalStateException
Throws:
IllegalStateException

doFinal

public final void doFinal(byte[] output,
                          int outOffset)
                   throws ShortBufferException,
                          IllegalStateException
Throws:
ShortBufferException
IllegalStateException

doFinal

public final byte[] doFinal(byte[] input)
                     throws IllegalStateException
Throws:
IllegalStateException

reset

public final void reset()

clone

public final Object clone()
                   throws CloneNotSupportedException
Description copied from class: Object
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.

Classes which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.

Overrides:
clone in class Object
Returns:
Object a shallow copy of this object.
Throws:
CloneNotSupportedException - if the receiver's class does not implement the interface Cloneable.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature