1package org.bouncycastle.operator;
2
3import java.io.OutputStream;
4
5import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
6
7public interface MacCalculator
8{
9    AlgorithmIdentifier getAlgorithmIdentifier();
10
11    /**
12     * Returns a stream that will accept data for the purpose of calculating
13     * the MAC for later verification. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate
14     * the data on the fly as well.
15     *
16     * @return an OutputStream
17     */
18    OutputStream getOutputStream();
19
20    /**
21     * Return the calculated MAC based on what has been written to the stream.
22     *
23     * @return calculated MAC.
24     */
25    byte[] getMac();
26
27
28    /**
29     * Return the key used for calculating the MAC.
30     *
31     * @return the MAC key.
32     */
33    GenericKey getKey();
34}