COM.claymoresystems.provider

Class DSASignature

public class DSASignature extends RawDSASignature

A class to perform DSA signature and verification.

This uses RawDSASignature to perform DSASignature with SHA hashing

See FIPS PUB 186, ANSI X9.57

Author: EKR

Constructor Summary
DSASignature()
Method Summary
protected voidengineInitSign(PrivateKey key)
SPI: Initializes this object for signing using the private key
protected voidengineInitVerify(PublicKey key)
SPI: Initializes this object for verification using the given key
protected byte[]engineSign()
Sign the input, following FIPS-186.
protected voidengineUpdate(byte b)
SPI: Single byte update
protected voidengineUpdate(byte[] b, int off, int len)
SPI: Update with a buffer
protected booleanengineVerify(byte[] signature)
SPI: Raw Verify

Constructor Detail

DSASignature

public DSASignature()

Method Detail

engineInitSign

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

Parameters: key the private key

Throws: InvalidKeyException if the key class doesn't implement than DSAPrivateKey

engineInitVerify

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

Parameters: key the public key

Throws: InvalidKeyException if the key class doesn't implement DSAPublicKey

engineSign

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

Throws: SignatureException if the engine isn't initialized properly

engineUpdate

protected void engineUpdate(byte b)
SPI: Single byte update

Throws: SignatureException in case of error

engineUpdate

protected void engineUpdate(byte[] b, int off, int len)
SPI: Update with a buffer

Throws: SignatureException in case of error

engineVerify

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

Throws: SignatureException bad input

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