#include <RSA.h>
Inheritance diagram for CODEX_Ciphers::RSAPrivateKey:


Public Member Functions | |
| RSAPrivateKey () | |
| Default constructor, for creating an object to be unmarshalled. | |
| RSAPrivateKey (BIGNUM *p, BIGNUM *q, BIGNUM *d, BIGNUM *n=0, BIGNUM *phi=0) | |
| Create an RSAPrivateKey from BIGNUM%s. | |
| RSAPrivateKey (const CODEX_ASN1::BigNumber &p, const CODEX_ASN1::BigNumber &q, const CODEX_ASN1::BigNumber &d) | |
| Create an RSAPrivateKey from BigNumber%s. | |
| RSAPrivateKey (const RSAPrivateKey &aKey) | |
| Copy constructor. | |
| virtual | ~RSAPrivateKey () |
| Destructor. | |
| void | operator= (const RSAPrivateKey &aKey) |
| Assignment operator. | |
| virtual const CODEX_ASN1::SecureBigNumber & | p () const |
| One prime factor of the public modulus. | |
| virtual const CODEX_ASN1::SecureBigNumber & | q () const |
| One prime factor of the public modulus. | |
| virtual const CODEX_ASN1::SecureBigNumber & | d () const |
| The private decryption exponent. | |
| virtual const CODEX_ASN1::SecureBigNumber & | n () const |
| The public modulus. | |
| virtual const CODEX_ASN1::SecureBigNumber & | phi () const |
| Euler totient function of n. | |
| BIGNUM * | decrypt (const RSACipherText &cipherText) const |
| Decrypt a message. | |
| RSASignature * | sign (const BIGNUM *message) const |
| Sign 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? | |
This is not an especially memory-efficient implementation, in that the public modulus and the Euler totient function of it are both stored and are also marshalled with the data. Since private keys are not typically sent over the wire and only need to be read during process initialization (or upon creation of a new key), this should not be a serious issue.
Definition at line 190 of file RSA.h.
|
||||||||||||||||||||||||
|
Create an RSAPrivateKey from BIGNUM%s.
Definition at line 36 of file RSAPrivateKey.cc. |
|
||||||||||||||||
|
Create an RSAPrivateKey from BigNumber%s.
Definition at line 132 of file RSAPrivateKey.cc. References p(), q(), and CODEX_ASN1::BigNumber::value(). |
|
|
Decrypt a message.
Definition at line 235 of file RSAPrivateKey.cc. |
|
|
Reads the private key from a file.
Definition at line 376 of file RSAPrivateKey.cc. References p(), and unmarshal(). |
|
||||||||||||
|
Reads the private key from a PEM-format file.
Definition at line 405 of file RSAPrivateKey.cc. |
|
|
|
Sign a message.
Reimplemented in CODEX_Ciphers::VarRSAPrivateKey. Definition at line 241 of file RSAPrivateKey.cc. Referenced by CODEX_APSS::InitActivity::addEvidence(), CODEX_APSS::SecretManagement::beginRun(), CODEX_Client::Client::createKey(), CODEX_Server::QuorumBuilderAct::handler(), CODEX_APSS::MessageProcessor::handler(), CODEX_APSS::InitActivity::handler(), CODEX_KeyService::ClientResponseSigner::handler(), CODEX_APSS::StateInfo::recover(), and CODEX_Ciphers::VarRSAPrivateKey::sign(). |
|
|
Writes the private key to a file.
Definition at line 353 of file RSAPrivateKey.cc. |
1.4.1