COM.claymoresystems.provider
Class RawDSASignature

java.lang.Object
  extended by java.security.SignatureSpi
      extended by java.security.Signature
          extended by COM.claymoresystems.provider.RawDSASignature
Direct Known Subclasses:
DSASignature

public class RawDSASignature
extends java.security.Signature


Field Summary
 
Fields inherited from class java.security.Signature
SIGN, state, UNINITIALIZED, VERIFY
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Constructor Summary
RawDSASignature()
           
RawDSASignature(java.lang.String name)
           
 
Method Summary
protected  java.lang.Object engineGetParameter(java.lang.String param)
           SPI: There aren't any parameters
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  void engineSetParameter(java.lang.String param, java.lang.Object value)
           SPI: There aren't any parameters
protected  byte[] engineSign()
          Sign the input, following FIPS-186.
protected  void engineUpdate(byte b)
          SPI: Single byte updates are forbidden for Raw DSA.
protected  void engineUpdate(byte[] b, int off, int len)
          SPI: Updates the digest.
protected  boolean engineVerify(byte[] signature)
          SPI: Raw Verify
 
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

RawDSASignature

public RawDSASignature(java.lang.String name)

RawDSASignature

public RawDSASignature()
Method Detail

engineInitVerify

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

Specified by:
engineInitVerify in class java.security.SignatureSpi
Parameters:
key - the public key
Throws:
java.security.InvalidKeyException - if the key class doesn't implement than DSAPublicKey

engineInitSign

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

Specified by:
engineInitSign in class java.security.SignatureSpi
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 updates are forbidden for Raw DSA.

Specified by:
engineUpdate in class java.security.SignatureSpi
Throws:
java.security.SignatureException - bad input

engineUpdate

protected void engineUpdate(byte[] b,
                            int off,
                            int len)
                     throws java.security.SignatureException
SPI: Updates the digest. Since we're doing raw DSA, this must be a 20 byte string. This can only be called once with a single digest value or we throw an error

Specified by:
engineUpdate in class java.security.SignatureSpi
Parameters:
b - the buffer containing the digest
off - the offset into the buffer
len - the length (must be 20)
Throws:
java.security.SignatureException - either if the algorithm was improperly initialized or you try to call update more than once

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 }

Specified by:
engineSign in class java.security.SignatureSpi
Throws:
java.security.SignatureException - if the engine isn't initialized properly

engineVerify

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

Specified by:
engineVerify in class java.security.SignatureSpi
Throws:
java.security.SignatureException - bad input

engineSetParameter

protected void engineSetParameter(java.lang.String param,
                                  java.lang.Object value)
                           throws java.security.InvalidParameterException
SPI: There aren't any parameters

Specified by:
engineSetParameter in class java.security.SignatureSpi
Throws:
java.security.InvalidParameterException

engineGetParameter

protected java.lang.Object engineGetParameter(java.lang.String param)
                                       throws java.security.InvalidParameterException
SPI: There aren't any parameters

Specified by:
engineGetParameter in class java.security.SignatureSpi
Throws:
java.security.InvalidParameterException


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