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

 VarRSAPublicKey (const RSAPublicKey &aKey)
 Constructor taking a reference to an RSAPublicKey.
virtual ~VarRSAPublicKey ()
 Destructor.
const CODEX_ASN1::BigNumbern () const
 Modulus of the public key.
const CODEX_ASN1::BigNumbere () const
 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.
RSACipherTextencrypt (const BIGNUM *message) const
 Encrypt a message.
bool verifySignature (const RSASignature &signature, const BIGNUM *message) const
 Verify the signature for 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 public key to a file.
void * fromFile (const char *fname)
 Reads the public key from a 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 public key, which wraps the regular RSA public key.

Definition at line 252 of file VarRSA.h.


Member Function Documentation

RSACipherText * RSAPublicKey::encrypt const BIGNUM *  message  )  const [inherited]
 

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.
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 88 of file RSAPublicKey.cc.

Referenced by CODEX_KeyService::DelegateResponseVerifier::handler(), CODEX_Client::Client::readKey(), and CODEX_Server::ServerState::thresholdOperation().

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().

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

Reads the public 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 234 of file RSAPublicKey.cc.

References CODEX_Ciphers::RSAPublicKey::unmarshal().

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().

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

Writes the public 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 212 of file RSAPublicKey.cc.

References CODEX_Ciphers::RSAPublicKey::marshal().

bool RSAPublicKey::verifySignature const RSASignature signature,
const BIGNUM *  message
const [inherited]
 

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 94 of file RSAPublicKey.cc.

Referenced by CODEX_Client::Client::createKey(), CODEX_Client::Client::getServiceKey(), CODEX_APSS::MessageVerifier::handler(), CODEX_KeyService::ClientMessageVerifier::handler(), CODEX_KeyService::VerifyWriteCallback::operator()(), CODEX_KeyService::SignWriteCallback::operator()(), CODEX_KeyService::SignReadCallback::operator()(), CODEX_KeyService::SignCreateCallback::operator()(), CODEX_KeyService::ClientWriteCallback::operator()(), CODEX_KeyService::ClientReadCallback::operator()(), CODEX_KeyService::ClientCreateCallback::operator()(), CODEX_Client::Client::readKey(), verifySignature(), and 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 303 of file VarRSA.h.

References CODEX_Ciphers::RSAPublicKey::verifySignature().


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