SiRSA Class Reference

This class implements the RSA public key crypto algorithms. More...

Inheritance diagram for SiRSA:

SiAlgorithm List of all members.

Public Member Functions

 SiRSA (RSA *key)
 constructor
virtual ~SiRSA ()
 destructor
virtual OFCondition sign (const unsigned char *inputHash, unsigned long inputHashSize, E_MACType inputHashAlgorithm, unsigned char *outputSignature, unsigned long &outputSignatureSize)
 creates a signature.
virtual OFCondition verify (const unsigned char *inputHash, unsigned long inputHashSize, E_MACType inputHashAlgorithm, const unsigned char *inputSignature, unsigned long inputSignatureSize, OFBool &verified)
 verifies a signature.
virtual unsigned long getSize () const
 returns the size of a block of encrypted/decrypted ciphertext in bytes.
virtual E_KeyType keyType () const
 returns the type of public key algorithm computed by this object

Private Member Functions

 SiRSA (SiRSA &arg)
 private undefined copy constructor
SiRSAoperator= (SiRSA &arg)
 private undefined copy assignment operator

Private Attributes

RSA * rsa
 RSA key used for signature/verification.

Detailed Description

This class implements the RSA public key crypto algorithms.

Definition at line 49 of file sirsa.h.


Constructor & Destructor Documentation

SiRSA::SiRSA ( RSA *  key  ) 

constructor

Parameters:
pointer to public RSA key


Member Function Documentation

virtual OFCondition SiRSA::sign ( const unsigned char *  inputHash,
unsigned long  inputHashSize,
E_MACType  inputHashAlgorithm,
unsigned char *  outputSignature,
unsigned long &  outputSignatureSize 
) [virtual]

creates a signature.

Parameters:
inputHash array of hash key bytes that are to be signed
inputHashSize length of hash key array in bytes
inputHashAlgorithm MAC algorithm used for creation of hash key. Required for creation of PKCS#1 RSA signature padding.
outputSignature pointer to array of at least getSize() which must be allocated by caller.
outputSignatureSize returns the number of bytes written to outputSignature.
Returns:
SI_EC_Normal if successful, errorcode otherwise.

Implements SiAlgorithm.

virtual OFCondition SiRSA::verify ( const unsigned char *  inputHash,
unsigned long  inputHashSize,
E_MACType  inputHashAlgorithm,
const unsigned char *  inputSignature,
unsigned long  inputSignatureSize,
OFBool &  verified 
) [virtual]

verifies a signature.

Parameters:
inputHash array of bytes containing hash key to be verified against signature
inputHashSize length of hash key array in bytes
inputHashAlgorithm MAC algorithm used for creation of hash key. Required for creation of PKCS#1 RSA signature padding.
inputSignature array of bytes containing signature to be verified
inputSignatureSize length of signature array in bytes
verified returns whether the signature was successfully verified
Returns:
SI_EC_Normal if successful, errorcode otherwise.

Implements SiAlgorithm.

virtual unsigned long SiRSA::getSize (  )  const [virtual]

returns the size of a block of encrypted/decrypted ciphertext in bytes.

The result depends on the public key algorithm, key size and padding scheme. In general the input to decrypt() or encrypt() must be less than or equal to this block size. The output of decrypt() or encrypt() is always equal to this block size.

Returns:
block size for this public key cryptosystem and key

Implements SiAlgorithm.

virtual E_KeyType SiRSA::keyType (  )  const [virtual]

returns the type of public key algorithm computed by this object

Returns:
type of public key algorithm

Implements SiAlgorithm.


The documentation for this class was generated from the following file:


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1