gnu.crypto.sig
Class BaseSignature
java.lang.Object
gnu.crypto.sig.BaseSignature
- Cloneable, ISignature
public abstract class BaseSignature
extends java.lang.Object
A base abstract class to facilitate implementations of concrete
Signatures.
Version:
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.
|
md
protected IMessageDigest md
The underlying message digest instance for this signature scheme.
privateKey
protected PrivateKey privateKey
The private key to use when generating signatures (signing).
publicKey
protected PublicKey publicKey
The public key to use when verifying signatures.
schemeName
protected String schemeName
The canonical name of this signature scheme.
BaseSignature
protected BaseSignature(String schemeName,
IMessageDigest md)
Trivial constructor.
schemeName
- the name of this signature scheme.md
- the underlying instance of the message digest algorithm.
generateSignature
protected Object generateSignature()
throws IllegalStateException
init
protected void init()
Initialises the internal fields of this instance.
nextRandomBytes
protected void nextRandomBytes(byte[] buffer)
Fills the designated byte array with random data.
buffer
- the byte array to fill with random data.
setupForSigning
protected void setupForSigning(PrivateKey key)
throws IllegalArgumentException
setupForVerification
protected void setupForVerification(PublicKey key)
throws IllegalArgumentException
setupSign
public void setupSign(Map attributes)
throws IllegalArgumentException
- setupSign in interface ISignature
setupVerify
public void setupVerify(Map attributes)
throws IllegalArgumentException
- setupVerify in interface ISignature
update
public void update(byte[] b,
int off,
int len)
- update in interface ISignature
verifySignature
protected boolean verifySignature(Object signature)
throws IllegalStateException
Copyright © 2001, 2002, 2003
Free Software Foundation,
Inc. All Rights Reserved.