COM.claymoresystems.provider
Class DSASignature

java.lang.Object
  extended by java.security.SignatureSpi
      extended by java.security.Signature
          extended by COM.claymoresystems.provider.RawDSASignature
              extended by COM.claymoresystems.provider.DSASignature

public class DSASignature
extends RawDSASignature


Field Summary
 
Fields inherited from class java.security.Signature
SIGN, state, UNINITIALIZED, VERIFY
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Constructor Summary
DSASignature()
           
 
Method Summary
protected  void engineInitSign(java.security.PrivateKey key)
          SPI: Initializes this object for signing using the private key
protected  void engineInitVerify(java.security.PublicKey key)
          SPI: Initializes this object for verification using the given key
protected  byte[] engineSign()
          Sign the input, following FIPS-186.
protected  void engineUpdate(byte b)
          SPI: Single byte update
protected  void engineUpdate(byte[] b, int off, int len)
          SPI: Update with a buffer
protected  boolean engineVerify(byte[] signature)
          SPI: Raw Verify
 
Methods inherited from class COM.claymoresystems.provider.RawDSASignature
engineGetParameter, engineSetParameter
 
Methods inherited from class java.security.Signature
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, update, verify, verify
 
Methods inherited from class java.security.SignatureSpi
engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate, engineVerify
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DSASignature

public DSASignature()
Method Detail

engineInitVerify

protected void engineInitVerify(java.security.PublicKey key)
                         throws java.security.InvalidKeyException
SPI: Initializes this object for verification using the given key

Overrides:
engineInitVerify in class RawDSASignature
Parameters:
key - the public key
Throws:
java.security.InvalidKeyException - if the key class doesn't implement DSAPublicKey

engineInitSign

protected void engineInitSign(java.security.PrivateKey key)
                       throws java.security.InvalidKeyException
SPI: Initializes this object for signing using the private key

Overrides:
engineInitSign in class RawDSASignature
Parameters:
key - the private key
Throws:
java.security.InvalidKeyException - if the key class doesn't implement than DSAPrivateKey

engineUpdate

protected void engineUpdate(byte b)
                     throws java.security.SignatureException
SPI: Single byte update

Overrides:
engineUpdate in class RawDSASignature
Throws:
java.security.SignatureException - in case of error

engineUpdate

protected void engineUpdate(byte[] b,
                            int off,
                            int len)
                     throws java.security.SignatureException
SPI: Update with a buffer

Overrides:
engineUpdate in class RawDSASignature
Parameters:
b - the buffer containing the digest
off - the offset into the buffer
len - the length (must be 20)
Throws:
java.security.SignatureException - in case of error

engineSign

protected byte[] engineSign()
                     throws java.security.SignatureException
Sign the input, following FIPS-186. The signature is encoded following ANSI X9.57: DSSSignature ::= SEQUENCE { r INTEGER, s INTEGER }

Overrides:
engineSign in class RawDSASignature
Throws:
java.security.SignatureException - if the engine isn't initialized properly

engineVerify

protected boolean engineVerify(byte[] signature)
                        throws java.security.SignatureException
SPI: Raw Verify

Overrides:
engineVerify in class RawDSASignature
Throws:
java.security.SignatureException - bad input


Copyright (c) 1999-2001 Claymore Systems, Inc., All Rights Reserved.