gnu.crypto.sig
public abstract class BaseSignature extends Object implements ISignature
A base abstract class to facilitate implementations of concrete Signatures.
Version: $Revision: 1.8 $
Field Summary | |
---|---|
protected IMessageDigest | md The underlying message digest instance for this signature scheme. |
protected PrivateKey | privateKey The private key to use when generating signatures (signing). |
protected PublicKey | publicKey The public key to use when verifying signatures. |
protected String | schemeName The canonical name of this signature scheme. |
Constructor Summary | |
---|---|
protected | BaseSignature(String schemeName, IMessageDigest md) Trivial constructor. |
Method Summary | |
---|---|
abstract Object | clone() |
protected abstract Object | generateSignature() |
protected void | init() Initialises the internal fields of this instance. |
String | name() |
protected void | nextRandomBytes(byte[] buffer) Fills the designated byte array with random data. |
protected abstract void | setupForSigning(PrivateKey key) |
protected abstract void | setupForVerification(PublicKey key) |
void | setupSign(Map attributes) |
void | setupVerify(Map attributes) |
Object | sign() |
void | update(byte b) |
void | update(byte[] b, int off, int len) |
boolean | verify(Object sig) |
protected abstract boolean | verifySignature(Object signature) |
Trivial constructor.
Parameters: schemeName the name of this signature scheme. md the underlying instance of the message digest algorithm.
Fills the designated byte array with random data.
Parameters: buffer the byte array to fill with random data.