package meerkat.bulletinboard;

import meerkat.crypto.DigitalSignature;
import meerkat.protobuf.BulletinBoardApi.*;

import java.security.SignatureException;

/**
 * Created by Arbel Deutsch Peled on 18-Dec-15.
 * Extends the DigitalSignature interface with methods for signing Bulletin Board messages
 */
public interface BulletinBoardSignature extends DigitalSignature {

    /**
     * Add msg to the content stream to be verified / signed
     * The digest only uses the part the signatures are computed on for this operation
     * If the message is a stub: this should be called before updating with the raw data
     * @param msg is the message that needs to be digested
     */
    public void updateContent(BulletinBoardMessage msg) throws SignatureException;

    /**
     * Add msg to the content stream to be verified / signed
     * If the message is a stub: this should be called before updating with the raw data
     * @param msg is the message that needs to be digested
     */
    public void updateContent(UnsignedBulletinBoardMessage msg) throws SignatureException;

}
