iaik.me.security.dsa
Class DSASignature

java.lang.Object
  |
  +--iaik.me.security.Signature
        |
        +--iaik.me.security.dsa.DSASignature

public class DSASignature
extends Signature


Fields inherited from class iaik.me.security.Signature
md, random
 
Constructor Summary
DSASignature()
           
 
Method Summary
 void initSign(PrivateKey privateKey, SecureRandom random)
          Initializes the signature instance for signing with a private key and a random number generator.
 void initVerify(PublicKey publicKey)
          Initializes the signature instance for verifiying a signature.
 byte[] sign()
          Creates a signature with the given data and private key.
 void update(byte[] input, int offset, int len)
          Updates the signature instance with the data that shall be signed or the data whose signature shall be verified.
 boolean verify(byte[] signature)
          This method verifies a given signature.
 
Methods inherited from class iaik.me.security.Signature
getAlgorithm, getInstance, register, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSASignature

public DSASignature()
             throws CryptoException
Method Detail

initSign

public void initSign(PrivateKey privateKey,
                     SecureRandom random)
              throws CryptoException
Description copied from class: Signature
Initializes the signature instance for signing with a private key and a random number generator.
Overrides:
initSign in class Signature
Following copied from class: iaik.me.security.Signature
Parameters:
privateKey - the signer's private key
random - optional if you want to use your own random number generator (if not, set this value to null).
Throws:
CryptoException -  

initVerify

public void initVerify(PublicKey publicKey)
                throws CryptoException
Description copied from class: Signature
Initializes the signature instance for verifiying a signature.
Overrides:
initVerify in class Signature
Following copied from class: iaik.me.security.Signature
Parameters:
publicKey - the signer's public key
Throws:
CryptoException -  

update

public void update(byte[] input,
                   int offset,
                   int len)
            throws CryptoException
Description copied from class: Signature
Updates the signature instance with the data that shall be signed or the data whose signature shall be verified. Use this method in case you don't want the whole byte array as input.
Overrides:
update in class Signature
Following copied from class: iaik.me.security.Signature
Parameters:
input - the input data
offset - starting index in the byte array
len - number of bytes to use as input beginnig from the starting index
Throws:
CryptoException -  

verify

public boolean verify(byte[] signature)
               throws CryptoException
Description copied from class: Signature
This method verifies a given signature. After initializing the signature instance do this:
 byte[] signature = rsa.sign();
 
to get the signature value.
Overrides:
verify in class Signature
Following copied from class: iaik.me.security.Signature
Parameters:
signature - the signature to be verified
Returns:
true if the signature could be successfully verified.
Throws:
CryptoException -  

sign

public byte[] sign()
            throws CryptoException
Description copied from class: Signature
Creates a signature with the given data and private key.
Overrides:
sign in class Signature
Following copied from class: iaik.me.security.Signature
Returns:
the signature as byte array
Throws:
CryptoException -  

This Javadoc may contain text parts from IETF Internet Standard specifications, see copyright note) and RSA Data Security Public-Key Cryptography Standards (see copyright note).

IAIK-JCE ME 3.04, (c) 2002 IAIK, (c) 2003 to 2006 Stiftung SIC