Save This Page
Home » openjdk-7 » javax » crypto » [javadoc | source]
javax.crypto
abstract public class: MacSpi [javadoc | source]
java.lang.Object
   javax.crypto.MacSpi
This class defines the Service Provider Interface (SPI) for the Mac class. All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply the implementation of a particular MAC algorithm.

Implementations are free to implement the Cloneable interface.

Method from javax.crypto.MacSpi Summary:
clone,   engineDoFinal,   engineGetMacLength,   engineInit,   engineReset,   engineUpdate,   engineUpdate,   engineUpdate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.crypto.MacSpi Detail:
 public Object clone() throws CloneNotSupportedException 
    Returns a clone if the implementation is cloneable.
 abstract protected byte[] engineDoFinal()
    Completes the MAC computation and resets the MAC for further use, maintaining the secret key that the MAC was initialized with.
 abstract protected int engineGetMacLength()
    Returns the length of the MAC in bytes.
 abstract protected  void engineInit(Key key,
    AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
    Initializes the MAC with the given (secret) key and algorithm parameters.
 abstract protected  void engineReset()
    Resets the MAC for further use, maintaining the secret key that the MAC was initialized with.
 abstract protected  void engineUpdate(byte input)
    Processes the given byte.
 protected  void engineUpdate(ByteBuffer input) 
    Processes input.remaining() bytes in the ByteBuffer input, starting at input.position(). Upon return, the buffer's position will be equal to its limit; its limit will not have changed.

    Subclasses should consider overriding this method if they can process ByteBuffers more efficiently than byte arrays.

 abstract protected  void engineUpdate(byte[] input,
    int offset,
    int len)
    Processes the first len bytes in input, starting at offset inclusive.