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

CODEX_Ciphers::VarRSAPrivateKey Class Reference

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

#include <VarRSA.h>

Inheritance diagram for CODEX_Ciphers::VarRSAPrivateKey:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 VarRSAPrivateKey (const RSAPrivateKey &aKey)
 Constructor taking a reference to an RSAPrivateKey.

virtual ~VarRSAPrivateKey ()
 Destructor.

const CODEX_ASN1::SecureBigNumberp () const
 
Returns:
one prime factor of the public modulus


const CODEX_ASN1::SecureBigNumberq () const
 
Returns:
one prime factor of the public modulus


const CODEX_ASN1::SecureBigNumberd () const
 
Returns:
the private decryption exponent.


const CODEX_ASN1::SecureBigNumbern () const
 
Returns:
the public modulus


const CODEX_ASN1::SecureBigNumberphi () const
 
Returns:
Euler totient function of n


BIGNUM * decrypt (const VarRSACipherText &cipherText, const HashFunction &hashFunc) const
 Decrypt a message.

VarRSABlindPlainTextdecryptBlind (const VarRSABlindCipherText &cipherText) const
 Decrypt a blinded message.

VarRSASignature * sign (const BIGNUM *message) const
 Sign a message.


Detailed Description

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

Definition at line 313 of file VarRSA.h.


Member Function Documentation

BIGNUM * VarRSAPrivateKey::decrypt const VarRSACipherText   cipherText,
const HashFunction   hashFunc
const
 

Decrypt a message.

Parameters:
cipherText  The encryption of a message using the public key corresponding to this private key.
hashFunc  Reference to a hash function.
Returns:
A pointer to a new BIGNUM containing the plaintext.
Exceptions:
BignumNullException  Some memory allocation failed.
BignumModExpException  There was an error during modular exponentiation.
BignumContextException  Memory allocation failed for a BN_CTX.

Definition at line 42 of file VarRSAPrivateKey.cc.

References CODEX_Ciphers::BIGNUM_xor(), CODEX_Ciphers::VarRSACipherText::c1(), CODEX_Ciphers::VarRSACipherText::c2(), CODEX_ASN1::BigNumber::marshal(), n(), and CODEX_ASN1::BigNumber::value().

VarRSABlindPlainText * VarRSAPrivateKey::decryptBlind const VarRSABlindCipherText   cipherText const
 

Decrypt a blinded message.

Parameters:
cipherText  The blind encryption of a message using the public key corresponding to this private key.
Returns:
A pointer to a new VarRSABlindPlainText containing the plaintext.
Exceptions:
BignumNullException  Some memory allocation failed.
BignumModExpException  There was an error during modular exponentiation.
BignumContextException  Memory allocation failed for a BN_CTX.

Definition at line 115 of file VarRSAPrivateKey.cc.

References CODEX_Ciphers::VarRSABlindCipherText::c1(), CODEX_Ciphers::VarRSABlindCipherText::c2(), and CODEX_ASN1::BigNumber::value().

VarRSASignature* CODEX_Ciphers::VarRSAPrivateKey::sign const BIGNUM *    message const [inline]
 

Sign a message.

Parameters:
message  Non-null pointer to a BIGNUM containing the message to sign. This message must be smaller than the modulus of the public key.
Returns:
A pointer to a new RSASignature 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.

Reimplemented from CODEX_Ciphers::RSAPrivateKey.

Definition at line 377 of file VarRSA.h.

References CODEX_Ciphers::RSAPrivateKey::sign().


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