01: package org.bouncycastle.crypto;
02:
03: import java.math.BigInteger;
04:
05: /**
06: * interface for classes implementing algorithms modeled similar to the Digital Signature Alorithm.
07: */
08: public interface DSA {
09: /**
10: * initialise the signer for signature generation or signature
11: * verification.
12: *
13: * @param forSigning true if we are generating a signature, false
14: * otherwise.
15: * @param param key parameters for signature generation.
16: */
17: public void init(boolean forSigning, CipherParameters param);
18:
19: /**
20: * sign the passed in message (usually the output of a hash function).
21: *
22: * @param message the message to be signed.
23: * @return two big integers representing the r and s values respectively.
24: */
25: public BigInteger[] generateSignature(byte[] message);
26:
27: /**
28: * verify the message message against the signature values r and s.
29: *
30: * @param message the message that was supposed to have been signed.
31: * @param r the r signature value.
32: * @param s the s signature value.
33: */
34: public boolean verifySignature(byte[] message, BigInteger r,
35: BigInteger s);
36: }
|