javax.crypto
Class Mac
java.lang.Object
javax.crypto.Mac
- All Implemented Interfaces:
- Cloneable
public class Mac
- extends Object
- implements Cloneable
Mac
protected Mac(MacSpi macSpi,
Provider provider,
String algorithm)
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.
Please submit a feedback, bug or feature