MIRA
|
Definition of a RSA key (public or private) More...
#include <security/RSAKey.h>
Public Member Functions | |
Constructors and destructor | |
RSAKey () | |
Default constructor. More... | |
RSAKey (const RSAKey &key) | |
The copy constructor. More... | |
RSAKey (const std::string &n, const std::string &e, const std::string &d) | |
Construct a new RSAKey with specific N, E and D (all in hex). More... | |
virtual | ~ RSAKey () |
The destructor. More... | |
Reflect operation | |
template<typename Reflector > | |
MIRA_SPLIT_REFLECT_MEMBER void | reflectRead (Reflector &r) |
Reflect. More... | |
template<typename Reflector > | |
void | reflectWrite (Reflector &r) |
General operations | |
bool | isValid () const |
Is this a valid key? More... | |
bool | isPublicKey () const |
Is this a public key? More... | |
bool | isPrivateKey () const |
Is this a private key? More... | |
bool | clear () |
Clear the key values. More... | |
Operators | |
RSAKey & | operator= (const RSAKey &key) |
The '=' operator. More... | |
bool | operator== (const RSAKey &key) |
The '==' operator. More... | |
bool | operator!= (const RSAKey &key) |
The '!=' operator. More... | |
Accessing the key components | |
const OpenSSLRSAWrapper * | getOpenSSLKey () const |
Return a pointer to the OpenSSL RSA key wrapper. More... | |
std::string | getNStr () const |
Get N as a hexadecimal number. More... | |
std::string | getEStr () const |
Get E as a hexadecimal number. More... | |
std::string | getDStr () const |
Get D as a hexadecimal number. More... | |
Static Public Member Functions | |
Static methods | |
static void | generateKey (unsigned int iKeyBitLength, RSAKey &oPublicKey, RSAKey &oPrivateKey) |
Generate a new RSA key. More... | |
static void | feedRandomNumberGenerator (size_t count) |
Feed the random number generator. More... | |
Friends | |
MIRA_BASE_EXPORT std::ostream & | operator<< (std::ostream &stream, const RSAKey &key) |
The '<<' operator for RSAKey. More... | |
MIRA_BASE_EXPORT std::istream & | operator>> (std::istream &stream, RSAKey &key) |
The '>>' operator for RSAKey. More... | |
Definition of a RSA key (public or private)
RSAKey | ( | ) |
Default constructor.
RSAKey | ( | const std::string & | n, |
const std::string & | e, | ||
const std::string & | d | ||
) |
Construct a new RSAKey with specific N, E and D (all in hex).
virtual ~ RSAKey | ( | ) |
The destructor.
|
inline |
Reflect.
|
inline |
bool isValid | ( | ) | const |
Is this a valid key?
bool isPublicKey | ( | ) | const |
Is this a public key?
bool isPrivateKey | ( | ) | const |
Is this a private key?
bool clear | ( | ) |
Clear the key values.
bool operator== | ( | const RSAKey & | key | ) |
The '==' operator.
bool operator!= | ( | const RSAKey & | key | ) |
The '!=' operator.
|
inline |
Return a pointer to the OpenSSL RSA key wrapper.
std::string getNStr | ( | ) | const |
Get N as a hexadecimal number.
std::string getEStr | ( | ) | const |
Get E as a hexadecimal number.
std::string getDStr | ( | ) | const |
Get D as a hexadecimal number.
|
static |
Generate a new RSA key.
[in] | iKeyBitLength | Number of bits (must be greater than 127). |
[out] | oPublicKey | The public key. |
[out] | oPrivateKey | The private key. |
|
static |
Feed the random number generator.
[in] | count | The number for random bytes. |
|
friend |
|
friend |
The '>>' operator for RSAKey.