All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.tls.crypto.TlsMAC Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for the TLS, including a JSSE provider. The APIs are designed primarily to be used in conjunction with the BC FIPS provider. The APIs may also be used with other providers although if being used in a FIPS context it is the responsibility of the user to ensure that any other providers used are FIPS certified and used appropriately.

There is a newer version: 2.0.19
Show newest version
package org.bouncycastle.tls.crypto;

/**
 * Interface for MAC services.
 */
public interface TlsMAC
{
    /**
     * Set the key to be used by the MAC implementation supporting this service.
     *
     * @param key array holding the MAC key.
     * @param keyOff offset into the array the key starts at.
     * @param keyLen length of the key in the array.
     */
    void setKey(byte[] key, int keyOff, int keyLen);

    /**
     * Update the MAC with the passed in input.
     *
     * @param input input array containing the data.
     * @param inOff offset into the input array the input starts at.
     * @param length the length of the input data.
     */
    void update(byte[] input, int inOff, int length);

    /**
     * Return calculated MAC for any input passed in.
     *
     * @return the MAC value.
     */
    byte[] calculateMAC();

    /**
     * Write the calculated MAC to an output buffer.
     *
     * @param output output array to write the MAC to.
     * @param outOff offset into the output array to write the MAC to.
     */
    void calculateMAC(byte[] output, int outOff);

    /**
     * Return the length of the MAC generated by this service.
     *
     * @return the MAC length.
     */
    int getMacLength();

    /**
     * Reset the MAC underlying this service.
     */
    void reset();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy