01: package org.bouncycastle.crypto;
02:
03: /**
04: * Generic signer interface for hash based and message recovery signers.
05: */
06: public interface Signer {
07: /**
08: * Initialise the signer for signing or verification.
09: *
10: * @param forSigning true if for signing, false otherwise
11: * @param param necessary parameters.
12: */
13: public void init(boolean forSigning, CipherParameters param);
14:
15: /**
16: * update the internal digest with the byte b
17: */
18: public void update(byte b);
19:
20: /**
21: * update the internal digest with the byte array in
22: */
23: public void update(byte[] in, int off, int len);
24:
25: /**
26: * generate a signature for the message we've been loaded with using
27: * the key we were initialised with.
28: */
29: public byte[] generateSignature() throws CryptoException,
30: DataLengthException;
31:
32: /**
33: * return true if the internal state represents the signature described
34: * in the passed in array.
35: */
36: public boolean verifySignature(byte[] signature);
37:
38: /**
39: * reset the internal state
40: */
41: public void reset();
42: }
|