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


Public Methods | |
| 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 BIGNUMs. | |
| RSAPrivateKey (const CODEX_ASN1::BigNumber &p, const CODEX_ASN1::BigNumber &q, const CODEX_ASN1::BigNumber &d) | |
| Create an RSAPrivateKey from BigNumbers. | |
| RSAPrivateKey (const RSAPrivateKey &aKey) | |
| Copy constructor. | |
| virtual | ~RSAPrivateKey () |
| Destructor. | |
| void | operator= (const RSAPrivateKey &aKey) |
| Assignment operator. | |
| virtual const CODEX_ASN1::SecureBigNumber & | p () const |
| |
| virtual const CODEX_ASN1::SecureBigNumber & | q () const |
| |
| virtual const CODEX_ASN1::SecureBigNumber & | d () const |
| |
| virtual const CODEX_ASN1::SecureBigNumber & | n () const |
| |
| virtual const CODEX_ASN1::SecureBigNumber & | phi () const |
| |
| 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. | |
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 187 of file RSA.h.
|
||||||||||||||||||||||||
|
Create an RSAPrivateKey from BIGNUMs.
Definition at line 36 of file RSAPrivateKey.cc. |
|
||||||||||||||||
|
Create an RSAPrivateKey from BigNumbers.
Definition at line 132 of file RSAPrivateKey.cc. References CODEX_ASN1::BigNumber::value(). |
|
|
Decrypt a message.
Definition at line 235 of file RSAPrivateKey.cc. References CODEX_ASN1::BigNumber::value(). |
|
|
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. References CODEX_ASN1::Base::m_initialized. |
|
|
|
Writes the private key to a file.
Definition at line 353 of file RSAPrivateKey.cc. |
1.2.18