For the latest news and information visit
The GNU Crypto project

gnu.crypto.jce.sig
Class SignatureAdapter

java.lang.Object
  extended by java.security.SignatureSpi
      extended by gnu.crypto.jce.sig.SignatureAdapter
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DSSRawSignatureSpi, RSAPSSRawSignatureSpi

 class SignatureAdapter
extends SignatureSpi
implements Cloneable

The implementation of a generic Signature adapter class to wrap gnu.crypto signature instances.

This class defines the Service Provider Interface (SPI) for the Signature class, which provides the functionality of a digital signature algorithm. Digital signatures are used for authentication and integrity assurance of digital data.

All the abstract methods in the SignatureSpi class are implemented by this class and all its sub-classes.

All the implementations which subclass this object, and which are serviced by the GNU Crypto provider implement the Cloneable interface.

Version:
$Revision: 1.2 $

Field Summary
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Constructor Summary
protected SignatureAdapter(String sigName, ISignatureCodec codec)
          Trivial protected constructor.
 
Method Summary
 Object clone()
           
 Object engineGetParameter(String param)
           
 void engineInitSign(PrivateKey privateKey)
           
 void engineInitSign(PrivateKey privateKey, SecureRandom random)
           
 void engineInitVerify(PublicKey publicKey)
           
 void engineSetParameter(AlgorithmParameterSpec params)
           
 void engineSetParameter(String param, Object value)
           
 byte[] engineSign()
           
 int engineSign(byte[] outbuf, int offset, int len)
           
 void engineUpdate(byte b)
           
 void engineUpdate(byte[] b, int off, int len)
           
 boolean engineVerify(byte[] sigBytes)
           
 
Methods inherited from class java.security.SignatureSpi
engineGetParameters, engineUpdate, engineVerify
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignatureAdapter

protected SignatureAdapter(String sigName,
                           ISignatureCodec codec)
Trivial protected constructor.

Parameters:
sigName - the canonical name of the signature scheme.
codec - the signature codec engine to use with this scheme.
Method Detail

clone

public Object clone()
Overrides:
clone in class SignatureSpi

engineInitVerify

public void engineInitVerify(PublicKey publicKey)
                      throws InvalidKeyException
Specified by:
engineInitVerify in class SignatureSpi
Throws:
InvalidKeyException

engineInitSign

public void engineInitSign(PrivateKey privateKey)
                    throws InvalidKeyException
Specified by:
engineInitSign in class SignatureSpi
Throws:
InvalidKeyException

engineInitSign

public void engineInitSign(PrivateKey privateKey,
                           SecureRandom random)
                    throws InvalidKeyException
Overrides:
engineInitSign in class SignatureSpi
Throws:
InvalidKeyException

engineUpdate

public void engineUpdate(byte b)
                  throws SignatureException
Specified by:
engineUpdate in class SignatureSpi
Throws:
SignatureException

engineUpdate

public void engineUpdate(byte[] b,
                         int off,
                         int len)
                  throws SignatureException
Specified by:
engineUpdate in class SignatureSpi
Throws:
SignatureException

engineSign

public byte[] engineSign()
                  throws SignatureException
Specified by:
engineSign in class SignatureSpi
Throws:
SignatureException

engineSign

public int engineSign(byte[] outbuf,
                      int offset,
                      int len)
               throws SignatureException
Overrides:
engineSign in class SignatureSpi
Throws:
SignatureException

engineVerify

public boolean engineVerify(byte[] sigBytes)
                     throws SignatureException
Specified by:
engineVerify in class SignatureSpi
Throws:
SignatureException

engineSetParameter

public void engineSetParameter(String param,
                               Object value)
                        throws InvalidParameterException
Specified by:
engineSetParameter in class SignatureSpi
Throws:
InvalidParameterException

engineSetParameter

public void engineSetParameter(AlgorithmParameterSpec params)
                        throws InvalidAlgorithmParameterException
Overrides:
engineSetParameter in class SignatureSpi
Throws:
InvalidAlgorithmParameterException

engineGetParameter

public Object engineGetParameter(String param)
                          throws InvalidParameterException
Specified by:
engineGetParameter in class SignatureSpi
Throws:
InvalidParameterException

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.