DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions
SiAlgorithm Class Reference

pure virtual base class of the public key crypto systems used for signature creation and verification. More...

+ Inheritance diagram for SiAlgorithm:

List of all members.

Public Member Functions

 SiAlgorithm ()
 default constructor
virtual ~SiAlgorithm ()
 destructor
virtual OFCondition sign (const unsigned char *inputHash, unsigned long inputHashSize, E_MACType inputHashAlgorithm, unsigned char *outputSignature, unsigned long &outputSignatureSize)=0
 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)=0
 verifies a signature.
virtual unsigned long getSize () const =0
 returns the size of a block of encrypted/decrypted ciphertext in bytes.
virtual E_KeyType keyType () const =0
 returns the type of public key algorithm computed by this object

Detailed Description

pure virtual base class of the public key crypto systems used for signature creation and verification.

All public key algorithm classes should inherit from this class. Instances of derived classes contain a single private or public key.


Member Function Documentation

virtual unsigned long SiAlgorithm::getSize ( ) const [pure 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

Implemented in SiRSA, and SiDSA.

virtual E_KeyType SiAlgorithm::keyType ( ) const [pure virtual]

returns the type of public key algorithm computed by this object

Returns:
type of public key algorithm

Implemented in SiRSA, and SiDSA.

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

creates a signature.

Parameters:
inputHasharray of hash key bytes that are to be signed
inputHashSizelength of hash key array in bytes
inputHashAlgorithmMAC algorithm used for creation of hash key. Required for creation of PKCS#1 RSA signature padding.
outputSignaturepointer to array of at least getSize() which must be allocated by caller.
outputSignatureSizereturns the number of bytes written to outputSignature.
Returns:
SI_EC_Normal if successful, errorcode otherwise.

Implemented in SiRSA, and SiDSA.

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

verifies a signature.

Parameters:
inputHasharray of bytes containing hash key to be verified against signature
inputHashSizelength of hash key array in bytes
inputHashAlgorithmMAC algorithm used for creation of hash key. Required for creation of PKCS#1 RSA signature padding.
inputSignaturearray of bytes containing signature to be verified
inputSignatureSizelength of signature array in bytes
verifiedreturns whether the signature was successfully verified
Returns:
SI_EC_Normal if successful, errorcode otherwise.

Implemented in SiRSA, and SiDSA.


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


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027