![]() |
Diana Software
|
fixed-size encryption with the raw RSA algorithm. For envelope see QCryptoRSAEnvelope. More...
Public Types | |
| enum | Mode { ENCRYPT , DECRYPT } |
| encrypt or decrypt mode More... | |
Public Member Functions | |
| QCryptoRSA (const std::string &pKey, const Mode mode, bool nopad=true) | |
| constructor: if ENCRYPT provide public key, otherwise provide private key More... | |
| virtual | ~QCryptoRSA () |
| destructor More... | |
| size_t | GetMessageSize () const |
| Get message size = lenght of key - 2. More... | |
| std::vector< unsigned char > | Process (const std::vector< unsigned char > &message) const |
| encrypt or decrypt message More... | |
Static Public Member Functions | |
| static std::vector< unsigned char > | ConvertDouble (const double message) |
| convert from double More... | |
| static double | ConvertDouble (const std::vector< unsigned char > &message) |
| convert to double More... | |
| static std::vector< unsigned char > | ConvertString (const std::string &message) |
| convert from string More... | |
| static std::string | ConvertString (const std::vector< unsigned char > &message) |
| convert to string More... | |
| static std::vector< unsigned char > | ConvertHex (const std::string &message) |
| convert from hex-string More... | |
| static std::string | ConvertHex (const std::vector< unsigned char > &message) |
| convert to hex-string More... | |
Private Member Functions | |
| unsigned char * | ConvertArray (const std::vector< unsigned char > &input, const size_t pad=0, const size_t beginpad=0) const |
| std::vector< unsigned char > | ConvertArray (const unsigned char *input, const size_t n) const |
| void | Print (const char *header, const unsigned char *data, const size_t n) |
Private Attributes | |
| Mode | fMode |
| RSA * | fRSA |
| unsigned char * | fOutput |
| bool | fNoPadding |
| int | fMsgLength |
| size_t | fRandomSize |
| size_t | fBeginPad |
fixed-size encryption with the raw RSA algorithm. For envelope see QCryptoRSAEnvelope.
Definition at line 18 of file QCryptoRSA.hh.
| enum QCryptoRSA::Mode |
| QCryptoRSA::QCryptoRSA | ( | const std::string & | pKey, |
| const Mode | mode, | ||
| bool | nopad = true |
||
| ) |
constructor: if ENCRYPT provide public key, otherwise provide private key
|
virtual |
destructor
Definition at line 69 of file QCryptoRSA.cc.
|
private |
Definition at line 217 of file QCryptoRSA.cc.
Referenced by Process().
|
private |
Definition at line 234 of file QCryptoRSA.cc.
|
static |
convert from double
Definition at line 124 of file QCryptoRSA.cc.
|
static |
convert to double
Definition at line 135 of file QCryptoRSA.cc.
References DianaThrow, err, and QERR_SIZE_NOT_MATCH.
|
static |
convert from hex-string
Definition at line 90 of file QCryptoRSA.cc.
References DianaThrow, err, and QERR_SIZE_NOT_MATCH.
|
static |
convert to hex-string
Definition at line 112 of file QCryptoRSA.cc.
|
static |
convert from string
Definition at line 73 of file QCryptoRSA.cc.
|
static |
convert to string
Definition at line 82 of file QCryptoRSA.cc.
|
inline |
Get message size = lenght of key - 2.
Definition at line 33 of file QCryptoRSA.hh.
References fMsgLength.
|
private |
Definition at line 244 of file QCryptoRSA.cc.
| std::vector< unsigned char > QCryptoRSA::Process | ( | const std::vector< unsigned char > & | message | ) | const |
encrypt or decrypt message
Definition at line 154 of file QCryptoRSA.cc.
References ConvertArray(), DECRYPT, DianaThrow, ENCRYPT, err, fBeginPad, fMode, fMsgLength, fNoPadding, fOutput, fRandomSize, fRSA, QERR_SIZE_NOT_MATCH, and QERR_UNKNOWN_ERR.
|
private |
Definition at line 64 of file QCryptoRSA.hh.
Referenced by ClassImp(), and Process().
|
private |
Definition at line 56 of file QCryptoRSA.hh.
Referenced by ClassImp(), and Process().
|
private |
Definition at line 62 of file QCryptoRSA.hh.
Referenced by ClassImp(), GetMessageSize(), and Process().
|
private |
Definition at line 61 of file QCryptoRSA.hh.
Referenced by ClassImp(), and Process().
|
private |
Definition at line 60 of file QCryptoRSA.hh.
Referenced by ClassImp(), and Process().
|
private |
Definition at line 63 of file QCryptoRSA.hh.
Referenced by ClassImp(), and Process().
|
private |
Definition at line 58 of file QCryptoRSA.hh.
Referenced by ClassImp(), and Process().