Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File 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 Member Functions

 VarRSAPrivateKey (const RSAPrivateKey &aKey)
 Constructor taking a reference to an RSAPrivateKey.
virtual ~VarRSAPrivateKey ()
 Destructor.
const CODEX_ASN1::SecureBigNumberp () const
 One prime factor of the public modulus.
const CODEX_ASN1::SecureBigNumberq () const
 One prime factor of the public modulus.
const CODEX_ASN1::SecureBigNumberd () const
 The private decryption exponent.
const CODEX_ASN1::SecureBigNumbern () const
 The public modulus.
const CODEX_ASN1::SecureBigNumberphi () const
 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.
VarRSASignaturesign (const BIGNUM *message) const
 Sign a message.
BIGNUM * decrypt (const RSACipherText &cipherText) const
 Decrypt a message.
int marshal (unsigned char **pp) const
 Serialize the object.
void * unmarshal (void *bogus, unsigned char **pp, long length)
 Unserialize the object.
void toFile (const char *fname) const
 Writes the private key to a file.
void * fromFile (const char *fname)
 Reads the private key from a file.
void fromPEMFile (const char *fname, const char *phrase=0)
 Reads the private key from a PEM-format file.
bool initialized () const

Protected Member Functions

BIGNUM * exponentiate (const BIGNUM *aBN) const

Protected Attributes

bool m_initialized
 Has this object been initialized yet, or is it still blank?

Detailed Description

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

Definition at line 316 of file VarRSA.h.


Member Function Documentation

BIGNUM * RSAPrivateKey::decrypt const RSACipherText cipherText  )  const [inherited]
 

Decrypt a message.

Parameters:
cipherText The encryption of a message using the public key corresponding to this private key.
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 235 of file RSAPrivateKey.cc.

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_ASN1::BigNumber::marshal(), and n().

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.

void * RSAPrivateKey::fromFile const char *  fname  )  [inherited]
 

Reads the private key from a file.

Parameters:
fname Name of the file from which to read the key
Exceptions:
FileCannotOpenException The file fname could not be opened.

Definition at line 376 of file RSAPrivateKey.cc.

References CODEX_Ciphers::RSAPrivateKey::p(), and CODEX_Ciphers::RSAPrivateKey::unmarshal().

void RSAPrivateKey::fromPEMFile const char *  fname,
const char *  phrase = 0
[inherited]
 

Reads the private key from a PEM-format file.

Parameters:
fname Name of the file from which to read the key
phrase Passphrase for the file. If 0 the user will be prompted for it.
Exceptions:
FileCannotOpenException The file fname could not be opened.
BignumContextException A BN_CTX could not be allocated.
BignumNullException A BIGNUM could not be allocated.
BignumSubException Error occurred in subtraction.
BignumMulException Error occurred in multiplication.

Definition at line 405 of file RSAPrivateKey.cc.

bool CODEX_ASN1::Base::initialized  )  const [inline, inherited]
 

Returns:
Has this object been initialized?

Definition at line 175 of file Base.h.

References CODEX_ASN1::Base::m_initialized.

Referenced by CODEX_APSS::SecretManagement::addComputeMsg(), CODEX_APSS::SecretManagement::addEstablishMsg(), CODEX_APSS::SecretManagement::addEstablishResponse(), CODEX_APSS::SecretManagement::addInitMsg(), CODEX_APSS::SecretManagement::addSharing(), CODEX_APSS::SecretManagement::addSubsharing(), CODEX_VSS::Combinatoric< NumT, ThreshT >::apply(), CODEX_Server::ServerState::caKey(), CODEX_KeyService::ClientCreateCallback::ClientCreateCallback(), CODEX_VSS::Combinatoric< NumT, ThreshT >::count(), CODEX_Server::QuorumBuilderAct::handler(), CODEX_APSS::MessageVerifier::handler(), CODEX_KeyService::DelegateResponseVerifier::handler(), CODEX_KeyService::DelegateRequestDistributor::handler(), CODEX_KeyService::ClientMessageVerifier::handler(), CODEX_KeyService::ClientMessageSigner::handler(), CODEX_VSS::SubshareLabel< LabelType >::marshal(), CODEX_KeyService::KeyInfo::marshal(), CODEX_VSS::LabeledShare< ShareType, OneWay >::marshal(), CODEX_VSS::ShareLabel< _ShareType, _OneWay >::marshal(), CODEX_VSS::ModExpFunctionalArgs::marshal(), CODEX_VSS::Combinatoric< NumT, ThreshT >::marshal(), CODEX_KeyService::SignWriteCallback::operator()(), CODEX_KeyService::SignReadCallback::operator()(), CODEX_KeyService::SignCreateCallback::operator()(), CODEX_VSS::ModExpFunctional::operator()(), CODEX_KeyService::ClientReadCallback::operator()(), CODEX_KeyService::ClientCreateCallback::operator()(), CODEX_VSS::Combinatoric< NumT, ThreshT >::operator+=(), CODEX_Server::ServerState::readElGamalShares(), CODEX_VSS::Combinatoric< NumT, ThreshT >::recover(), CODEX_APSS::SecretManagement::sendFinished(), CODEX_Server::ServerState::serviceKey(), CODEX_Server::ServerState::setEGShareCallback(), and CODEX_Server::ServerState::setRSAShareCallback().

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 380 of file VarRSA.h.

References CODEX_Ciphers::RSAPrivateKey::sign().

void RSAPrivateKey::toFile const char *  fname  )  const [inherited]
 

Writes the private key to a file.

Parameters:
fname Name of the file in which to store the key
Exceptions:
FileCannotCreateException The file fname could not be created.

Definition at line 353 of file RSAPrivateKey.cc.

References CODEX_Ciphers::RSAPrivateKey::marshal(), and CODEX_Ciphers::RSAPrivateKey::p().


The documentation for this class was generated from the following files:
Generated on Fri May 6 17:41:55 2005 for COrnell Data EXchange (CODEX) by  doxygen 1.4.1