org.xlattice
Class SigVerifier

java.lang.Object
  extended by org.xlattice.SigVerifier

public abstract class SigVerifier
extends java.lang.Object

Given a PublicKey, instances of this class can verify digital signatures.

Author:
Jim Dixon

Constructor Summary
protected SigVerifier()
           
 
Method Summary
abstract  java.lang.String getAlgorithm()
           
abstract  void init(PublicKey pubkey)
          Initialize the verifier for use with a particular PublicKey.
abstract  SigVerifier update(byte[] data)
          Add block of data to that being checked.
abstract  SigVerifier update(byte[] data, int offset, int len)
           
abstract  boolean verify(byte[] digSig)
          Check the digital signature passed against the data accumulated.
abstract  boolean verify(byte[] digSig, int offset, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigVerifier

protected SigVerifier()
Method Detail

getAlgorithm

public abstract java.lang.String getAlgorithm()

init

public abstract void init(PublicKey pubkey)
                   throws CryptoException
Initialize the verifier for use with a particular PublicKey.

Parameters:
pubkey - PublicKey against which digital signature is verified
Throws:
CryptoException

update

public abstract SigVerifier update(byte[] data)
                            throws CryptoException
Add block of data to that being checked.

Parameters:
data - byte array being added
Returns:
reference to this verifier as a convenience in chaining
Throws:
CryptoException

update

public abstract SigVerifier update(byte[] data,
                                   int offset,
                                   int len)
                            throws CryptoException
Throws:
CryptoException

verify

public abstract boolean verify(byte[] digSig)
                        throws CryptoException
Check the digital signature passed against the data accumulated.

Parameters:
digSig - signature being checked
Returns:
whether the check is successful
Throws:
CryptoException

verify

public abstract boolean verify(byte[] digSig,
                               int offset,
                               int len)
                        throws CryptoException
Throws:
CryptoException