edu.vt.middleware.crypt.signature
Class ECDSASignature

java.lang.Object
  extended by edu.vt.middleware.crypt.AbstractAlgorithm
      extended by edu.vt.middleware.crypt.signature.SignatureAlgorithm
          extended by edu.vt.middleware.crypt.signature.AbstractDSASignature
              extended by edu.vt.middleware.crypt.signature.ECDSASignature
All Implemented Interfaces:
Algorithm

public class ECDSASignature
extends AbstractDSASignature

Implements the ECDSA algorithm.

Version:
$Revision: 2744 $
Author:
Middleware Services

Field Summary
 
Fields inherited from class edu.vt.middleware.crypt.signature.AbstractDSASignature
signer
 
Fields inherited from class edu.vt.middleware.crypt.signature.SignatureAlgorithm
digest, signKey, verifyKey
 
Fields inherited from class edu.vt.middleware.crypt.AbstractAlgorithm
algorithm, logger, randomByteSize, randomProvider
 
Constructor Summary
ECDSASignature()
          Creates a new ECDSA signature instance that uses SHA-1 for computation of message digests.
ECDSASignature(DigestAlgorithm d)
          Creates a new ECDSA signature instance that uses the given digest algorithm for message digest computation.
 
Method Summary
protected  void init(boolean forSigning, org.bouncycastle.crypto.CipherParameters params)
          Initialize the signer.
 void initSign()
          Initialize the signature for the SignatureAlgorithm.sign(byte[]) operation.
 void initVerify()
          Initialize the signature for the SignatureAlgorithm.verify(byte[], byte[]) operation.
 void setSignKey(PrivateKey key)
          Sets the private key used for signing.
 void setVerifyKey(PublicKey key)
          Sets the public key used for verification.
 
Methods inherited from class edu.vt.middleware.crypt.signature.AbstractDSASignature
sign, sign, verify, verify
 
Methods inherited from class edu.vt.middleware.crypt.signature.SignatureAlgorithm
clone, newInstance, newInstance, sign, sign, verify, verify
 
Methods inherited from class edu.vt.middleware.crypt.AbstractAlgorithm
getAlgorithm, getRandomData, setRandomProvider, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ECDSASignature

public ECDSASignature()
Creates a new ECDSA signature instance that uses SHA-1 for computation of message digests.


ECDSASignature

public ECDSASignature(DigestAlgorithm d)
Creates a new ECDSA signature instance that uses the given digest algorithm for message digest computation.

Parameters:
d - Message digest algorithm.
Method Detail

setSignKey

public void setSignKey(PrivateKey key)
Sets the private key used for signing.

Overrides:
setSignKey in class SignatureAlgorithm
Parameters:
key - Private key.

setVerifyKey

public void setVerifyKey(PublicKey key)
Sets the public key used for verification.

Overrides:
setVerifyKey in class SignatureAlgorithm
Parameters:
key - Public key.

initSign

public void initSign()
Initialize the signature for the SignatureAlgorithm.sign(byte[]) operation.

Overrides:
initSign in class SignatureAlgorithm

initVerify

public void initVerify()
Initialize the signature for the SignatureAlgorithm.verify(byte[], byte[]) operation.

Overrides:
initVerify in class SignatureAlgorithm

init

protected void init(boolean forSigning,
                    org.bouncycastle.crypto.CipherParameters params)
Initialize the signer.

Overrides:
init in class AbstractDSASignature
Parameters:
forSigning - Whether to initialize signer for the sign operation.
params - BC cipher parameters.


Copyright © 2003-2013 Virginia Tech. All Rights Reserved.