COM.claymoresystems.provider

Class RSASignature

Implemented Interfaces:
Blindable

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 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()
SPI: Sign the input
protected void
engineUpdate(byte b)
SPI: Single byte updates are forbidden
protected void
engineUpdate(byte[] b, int off, int len)
SPI: Updates the data.
protected boolean
engineVerify(byte[] signature)
SPI: Verify the input
void
setBlindingInfo(SecureRandom rng, CryptixRSAPublicKey pubKey)
set the RNG for blinding
protected byte[]
sigToBytes(BigInteger num)

Constructor Details

RSASignature

public RSASignature()

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
SPI: Sign the input
Returns:
a signature as a byte string

engineUpdate

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

engineUpdate

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

engineVerify

protected boolean engineVerify(byte[] signature)
            throws SignatureException
SPI: Verify the input
Returns:
true or false

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.