Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

CODEX_Ciphers::VarRSAPublicKey Class Reference

The RSA variant public key, which wraps the regular RSA public key. More...

#include <VarRSA.h>

Inheritance diagram for CODEX_Ciphers::VarRSAPublicKey:

Inheritance graph
[legend]
Collaboration diagram for CODEX_Ciphers::VarRSAPublicKey:

Collaboration graph
[legend]
List of all members.

Public Methods

 VarRSAPublicKey (const RSAPublicKey &aKey)
 Constructor taking a reference to an RSAPublicKey.

virtual ~VarRSAPublicKey ()
 Destructor.

const CODEX_ASN1::BigNumbern () const
 
Returns:
modulus of the public key


const CODEX_ASN1::BigNumbere () const
 
Returns:
encryption exponent


VarRSACipherTextencrypt (const BIGNUM *message, const HashFunction &hashFunc, BIGNUM *r=0) const
 Encrypt a message.

bool verifySignature (const VarRSASignature &signature, const BIGNUM *message) const
 Verify the signature for a message.


Detailed Description

The RSA variant public key, which wraps the regular RSA public key.

Definition at line 249 of file VarRSA.h.


Member Function Documentation

VarRSACipherText * VarRSAPublicKey::encrypt const BIGNUM *    message,
const HashFunction   hashFunc,
BIGNUM *    r = 0
const
 

Encrypt a message.

Parameters:
message  Non-null pointer to a BIGNUM containing the message to encrypt. This message must be smaller than the modulus of the public key.
hashFunc  Reference to a hash function.
r  If not 0, the random encryption base will be returned.
Returns:
A pointer to a new RSACipherText object.
Exceptions:
BignumNullException  The message is 0 or some memory allocation failed.
BignumModExpException  There was an error during modular exponentiation.
BignumContextException  Memory allocation failed for a BN_CTX.

Definition at line 34 of file VarRSAPublicKey.cc.

References CODEX_Ciphers::BIGNUM_xor(), CODEX_ASN1::BigNumber::marshal(), and n().

Referenced by CODEX_Client::Client::writeKey().

bool CODEX_Ciphers::VarRSAPublicKey::verifySignature const VarRSASignature &    signature,
const BIGNUM *    message
const [inline]
 

Verify the signature for a message.

Parameters:
signature  Signature object to verify
message  Non-null pointer to a BIGNUM containing the message allegedly signed with signature. The message must be smaller than the modulus of the public key, and might be a digest of a longer message.
Returns:
Success or failure of the signature verification
Exceptions:
BignumNullException  The message is 0 or some memory allocation failed.
BignumModExpException  There was an error during modular exponentiation.
BignumContextException  Memory allocation failed for a BN_CTX.

Definition at line 300 of file VarRSA.h.

References CODEX_Ciphers::RSAPublicKey::verifySignature().


The documentation for this class was generated from the following files:
Generated on Wed Jun 2 16:33:05 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18