fi.hut.tcm.tessa.ECImplementation
Class ECDSASignature

java.lang.Object
  |
  +--java.security.SignatureSpi
        |
        +--fi.hut.tcm.tessa.ECImplementation.ECDSASignature

public class ECDSASignature
extends SignatureSpi

ECDSASignature Creates and vefies ECDSA (Elliptic Curve Digital Signature Algorithm) signatures. ECDSA has been defined in ANSI X9.62 and IEEE P1363 standards.


Field Summary
protected  SecureRandom appRandom
           
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Constructor Summary
ECDSASignature()
          The default constructor that initialises the message digest used.
 
Method Summary
 Object clone()
          Clones the signature object.
protected  Object engineGetParameter(String param)
          Deprecated.  
protected  void engineInitSign(PrivateKey privateKey)
           
protected  void engineInitSign(PrivateKey privateKey, SecureRandom random)
           
protected  void engineInitVerify(PublicKey publicKey)
           
protected  void engineSetParameter(AlgorithmParameterSpec params)
           
protected  void engineSetParameter(String param, Object value)
          Deprecated. Replaced by engineSetParameter.
protected  byte[] engineSign()
           
protected  void engineUpdate(byte b)
           
protected  void engineUpdate(byte[] b, int off, int len)
           
protected  boolean engineVerify(byte[] sigBytes)
           
 
Methods inherited from class java.security.SignatureSpi
engineSign
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appRandom

protected SecureRandom appRandom
Constructor Detail

ECDSASignature

public ECDSASignature()
The default constructor that initialises the message digest used.
Method Detail

engineInitVerify

protected void engineInitVerify(PublicKey publicKey)
                         throws InvalidKeyException
Parameters:
publicKey - the public key of the identity whose signature is going to be verified.
Throws:
InvalidKeyException - if the key is improperly encoded, parameters are missing, and so on.
Overrides:
engineInitVerify in class SignatureSpi

engineInitSign

protected void engineInitSign(PrivateKey privateKey)
                       throws InvalidKeyException
Parameters:
privateKey - the private key of the identity whose signature will be generated.
Throws:
InvalidKeyException - if the key is improperly encoded, parameters are missing, and so on.
Overrides:
engineInitSign in class SignatureSpi

engineInitSign

protected void engineInitSign(PrivateKey privateKey,
                              SecureRandom random)
                       throws InvalidKeyException
Parameters:
privateKey - the private key of the identity whose signature will be generated.
Throws:
InvalidKeyException - if the key is improperly encoded, parameters are missing, and so on.
Overrides:
engineInitSign in class SignatureSpi

engineUpdate

protected void engineUpdate(byte b)
                     throws SignatureException
Parameters:
b - the byte to use for the update.
Throws:
SignatureException - if the engine is not initialized properly.
Overrides:
engineUpdate in class SignatureSpi

engineUpdate

protected void engineUpdate(byte[] b,
                            int off,
                            int len)
                     throws SignatureException
Parameters:
data - the array of bytes.
off - the offset to start from in the array of bytes.
len - the number of bytes to use, starting at offset.
Throws:
SignatureException - if the engine is not initialized properly.
Overrides:
engineUpdate in class SignatureSpi

engineSign

protected byte[] engineSign()
                     throws SignatureException
Returns:
the signature bytes of the signing operation's result.
Throws:
SignatureException - if the engine is not initialized properly.
Overrides:
engineSign in class SignatureSpi

engineVerify

protected boolean engineVerify(byte[] sigBytes)
                        throws SignatureException
Parameters:
sigBytes - the signature bytes to be verified.
Returns:
true if the signature was verified, false if not.
Throws:
SignatureException - if the engine is not initialized properly, or the passed-in signature is improperly encoded or of the wrong type, etc.
Overrides:
engineVerify in class SignatureSpi

engineSetParameter

protected void engineSetParameter(String param,
                                  Object value)
                           throws InvalidParameterException
Deprecated. Replaced by engineSetParameter.
Parameters:
param - the string identifier of the parameter.
value - the parameter value.
Throws:
InvalidParameterException - if param is an invalid parameter for this signature algorithm engine, the parameter is already set and cannot be set again, a security exception occurs, and so on.
Overrides:
engineSetParameter in class SignatureSpi

engineSetParameter

protected void engineSetParameter(AlgorithmParameterSpec params)
Overrides:
engineSetParameter in class SignatureSpi

engineGetParameter

protected Object engineGetParameter(String param)
                             throws InvalidParameterException
Deprecated.  
Parameters:
param - the string name of the parameter.
Returns:
the object that represents the parameter value, or null if there is none.
Throws:
InvalidParameterException - if param is an invalid parameter for this engine, or another exception occurs while trying to get this parameter.
Overrides:
engineGetParameter in class SignatureSpi

clone

public Object clone()
             throws CloneNotSupportedException
Clones the signature object. NOT SUPPORTED.
Overrides:
clone in class SignatureSpi