edu.vt.middleware.crypt.signature
Class DSASignature

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.DSASignature
All Implemented Interfaces:
Algorithm

public class DSASignature
extends AbstractDSASignature

Implements the DSA signature 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
DSASignature()
          Creates a new DSA signature class that uses a SHA-1 for message digest computation.
DSASignature(DigestAlgorithm d)
          Creates a new DSA signature class that uses the given digest algorithm for message digest computation.
 
Method Summary
 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
init, 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

DSASignature

public DSASignature()
Creates a new DSA signature class that uses a SHA-1 for message digest computation. This is the conventional DSA signature configuration.


DSASignature

public DSASignature(DigestAlgorithm d)
Creates a new DSA signature class 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


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