Code example for Mac

Methods: init

    private Mac lastMAC    = null;
    public MACData() throws NoSuchAlgorithmException, InvalidKeyException { 
        defaultMAC = Mac.getInstance(macType);
     * Adds a MAC of the data to the byte array following the data 
     * @param data 
     *            - the buffer holding the data for the MAC, and the MAC 
     * @param start 
     *            - inclusive start of data 
     * @param end 
     *            - inclusive end of data, mac added after this 
     * @throws javax.crypto.ShortBufferException 
     *             - if the buffer is insufficiently long to hold the mac 
     * @throws SecurityException 
Contextual code suggestions in your IDE  Get Codota for Java