COM.claymoresystems.provider

Class RawDSASignature

Known Direct Subclasses:
DSASignature

public class RawDSASignature
extends Signature

A class to perform DSA signature and verification.

This is necessary because Sun's provider does not do raw mode.

See FIPS PUB 186, ANSI X9.57

Author:
EKR

Constructor Summary

RawDSASignature()
RawDSASignature(String name)

Method Summary

protected Object
engineGetParameter(String param)
SPI: There aren't any parameters
protected void
engineInitSign(PrivateKey key)
SPI: Initializes this object for signing using the private key
protected void
engineInitVerify(PublicKey key)
SPI: Initializes this object for verification using the given key
protected void
engineSetParameter(String param, 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

Constructor Details

RawDSASignature

public RawDSASignature()


RawDSASignature

public RawDSASignature(String name)

Method Details

engineGetParameter

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


engineInitSign

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

Parameters:
key - the private key


engineInitVerify

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

Parameters:
key - the public key


engineSetParameter

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


engineSign

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


engineUpdate

protected void engineUpdate(byte b)
            throws SignatureException
SPI: Single byte updates are forbidden for Raw DSA.


engineUpdate

protected void engineUpdate(byte[] b,
                            int off,
                            int len)
            throws 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

Parameters:
b - the buffer containing the digest
off - the offset into the buffer
len - the length (must be 20)


engineVerify

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


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