COM.claymoresystems.provider

Class RSASignature

public class RSASignature extends Signature implements Blindable

This class implements RSA signature w/ PKCS#1 padding but no DigestInfo encoding because Cryptix doesn't and SSL requires it for Client Auth.

We assume that we already have an RSAEncryption primitive floating around.

Constructor Summary
RSASignature()
Method Summary
protected ObjectengineGetParameter(String param)
SPI: There aren't any parameters
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 voidengineSetParameter(String param, Object value)
SPI: There aren't any parameters
protected byte[]engineSign()
SPI: Sign the input
protected voidengineUpdate(byte b)
SPI: Single byte updates are forbidden
protected voidengineUpdate(byte[] b, int off, int len)
SPI: Updates the data.
protected booleanengineVerify(byte[] signature)
SPI: Verify the input
voidsetBlindingInfo(SecureRandom rng, CryptixRSAPublicKey pubKey)
set the RNG for blinding
protected byte[]sigToBytes(BigInteger num)

Constructor Detail

RSASignature

public RSASignature()

Method Detail

engineGetParameter

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

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 CryptixRSAPrivateKey

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 CryptixRSAPublicKey

engineSetParameter

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

engineSign

protected byte[] engineSign()
SPI: Sign the input

Returns: a signature as a byte string

Throws: SignatureException bad input

engineUpdate

protected void engineUpdate(byte b)
SPI: Single byte updates are forbidden

Throws: SignatureException if you do a single byte update

engineUpdate

protected void engineUpdate(byte[] b, int off, int len)
SPI: Updates the data. This can only be called once with a single data value or we throw an error

Parameters: b the buffer containing the data off the offset into the buffer len the length

Throws: SignatureException either if the algorithm was improperly initialized or you try to call update more than once

engineVerify

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

Returns: true or false

Throws: SignatureException bad input

setBlindingInfo

public void setBlindingInfo(SecureRandom rng, CryptixRSAPublicKey pubKey)
set the RNG for blinding

Parameters: rng a secure RNG

sigToBytes

protected byte[] sigToBytes(BigInteger num)
Copyright (c) 1999-2001 Claymore Systems, Inc., All Rights Reserved.