com.ibm.security12.sun.security.provider
Class DSA

java.lang.Object
  |
  +--com.ibm.security12.java.security.SignatureSpi
        |
        +--com.ibm.security12.java.security.Signature
              |
              +--com.ibm.security12.sun.security.provider.DSA

public final class DSA
extends Signature

The Digital Signature Standard (using the Digital Signature Algorithm), as described in fips186 of the National Instute of Standards and Technology (NIST), using fips180-1 (SHA-1).

Version:
1.85, 98/09/11
Author:
Benjamin Renaud
See Also:
DSAPublicKey, DSAPrivateKey

Fields inherited from class com.ibm.security12.java.security.Signature
SIGN, state, UNINITIALIZED, VERIFY
 
Fields inherited from class com.ibm.security12.java.security.SignatureSpi
appRandom
 
Constructor Summary
DSA()
          Construct a blank DSA object.
 
Method Summary
protected  Object engineGetParameter(String key)
          Deprecated.  
protected  void engineInitSign(PrivateKey privateKey)
          Initialize the DSA object with a DSA private key.
protected  void engineInitVerify(PublicKey publicKey)
          Initialize the DSA object with a DSA public key.
protected  void engineSetParameter(String key, Object param)
          Deprecated.  
protected  byte[] engineSign()
          Sign all the data thus far updated.
protected  void engineUpdate(byte b)
          Update a byte to be signed or verified.
protected  void engineUpdate(byte[] data, int off, int len)
          Update an array of bytes to be signed or verified.
protected  boolean engineVerify(byte[] signature)
          Verify all the data thus far updated.
 String toString()
          Return a human readable rendition of the engine.
 
Methods inherited from class com.ibm.security12.java.security.Signature
clone, getAlgorithm, getInstance, getInstance, getParameter, getProvider, initSign, initSign, initVerify, setParameter, setParameter, sign, sign, update, update, update, verify
 
Methods inherited from class com.ibm.security12.java.security.SignatureSpi
engineInitSign, engineSetParameter, engineSign
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DSA

public DSA()
    throws NoSuchAlgorithmException
Construct a blank DSA object. It can generate keys, but must be initialized before being usable for signing or verifying.
Method Detail

engineInitSign

protected void engineInitSign(PrivateKey privateKey)
                       throws InvalidKeyException
Initialize the DSA object with a DSA private key.
Parameters:
privateKey - the DSA private key
Throws:
InvalidKeyException - if the key is not a valid DSA private key.
Overrides:
engineInitSign in class SignatureSpi

engineInitVerify

protected void engineInitVerify(PublicKey publicKey)
                         throws InvalidKeyException
Initialize the DSA object with a DSA public key.
Parameters:
publicKey - the DSA public key.
Throws:
InvalidKeyException - if the key is not a valid DSA public key.
Overrides:
engineInitVerify in class SignatureSpi

engineSign

protected byte[] engineSign()
                     throws SignatureException
Sign all the data thus far updated. The signature is formatted according to the Canonical Encoding Rules, returned as a DER sequence of Integer, r and s.
Returns:
a signature block formatted according to the Canonical Encoding Rules.
Throws:
SignatureException - if the signature object was not properly initialized, or if another exception occurs.
Overrides:
engineSign in class SignatureSpi
See Also:
sun.security.DSA#engineUpdate, sun.security.DSA#engineVerify

engineVerify

protected boolean engineVerify(byte[] signature)
                        throws SignatureException
Verify all the data thus far updated.
Parameters:
signature - the alledged signature, encoded using the Canonical Encoding Rules, as a sequence of integers, r and s.
Throws:
SignatureException - if the signature object was not properly initialized, or if another exception occurs.
Overrides:
engineVerify in class SignatureSpi
See Also:
sun.security.DSA#engineUpdate, sun.security.DSA#engineSign

engineSetParameter

protected void engineSetParameter(String key,
                                  Object param)
Deprecated.  
This implementation recognizes the following parameter:
Kseed
a byte array.
Overrides:
engineSetParameter in class SignatureSpi

engineGetParameter

protected Object engineGetParameter(String key)
Deprecated.  
Return the value of the requested parameter. Recognized parameters are:
Kseed
a byte array.
Returns:
the value of the requested parameter.
Overrides:
engineGetParameter in class SignatureSpi
See Also:
java.security.SignatureEngine

engineUpdate

protected void engineUpdate(byte b)
Update a byte to be signed or verified.
Parameters:
b - the byte to updated.
Overrides:
engineUpdate in class SignatureSpi

engineUpdate

protected void engineUpdate(byte[] data,
                            int off,
                            int len)
Update an array of bytes to be signed or verified.
Parameters:
data - the bytes to be updated.
Overrides:
engineUpdate in class SignatureSpi

toString

public String toString()
Return a human readable rendition of the engine.
Overrides:
toString in class Signature