MIRA
|
A class for signing and verifying messages using a RSA key pair. More...
#include <security/RSASignature.h>
Public Types | |
enum | DigestType { DIGEST_MD5, DIGEST_SHA1, DIGEST_SHA256, DIGEST_SHA512 } |
The digest type. More... | |
Public Member Functions | |
Constuctors and destructor | |
RSASignature () | |
Default constructor. More... | |
RSASignature (const RSASignature &signatur) | |
The copy constructor. More... | |
virtual | ~RSASignature () |
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) |
Operators | |
RSASignature & | operator= (const RSASignature &signature) |
The '=' operator. More... | |
Message signature information | |
size_t | getSize () const |
Return the size of the RSA signature. More... | |
const uint8 * | getSignature () const |
Return the signature in a binary format. More... | |
Static Public Member Functions | |
Sign and verify a message | |
static RSASignature | signMessage (const RSAKey &iPrivateKey, DigestType iDigestType, const char *iMsg, size_t iMsgLen) |
Sign a message based on the private RSA key of the sender. More... | |
static bool | verifyMessage (const RSAKey &iPublicKey, DigestType iDigestType, const char *iMsg, size_t iMsgLen, const RSASignature &iSignature) |
Verify a message signature based on the public RSA of the sender. More... | |
Friends | |
MIRA_BASE_EXPORT std::ostream & | operator<< (std::ostream &stream, const RSASignature &signature) |
The '<<' operator for RSASignature. More... | |
MIRA_BASE_EXPORT std::istream & | operator>> (std::istream &stream, RSASignature &signature) |
The '>>' operator for RSASignature. More... | |
A class for signing and verifying messages using a RSA key pair.
enum DigestType |
RSASignature | ( | ) |
Default constructor.
RSASignature | ( | const RSASignature & | signatur | ) |
The copy constructor.
|
virtual |
The destructor.
|
inline |
Reflect.
|
inline |
RSASignature& operator= | ( | const RSASignature & | signature | ) |
The '=' operator.
|
inline |
Return the size of the RSA signature.
|
inline |
Return the signature in a binary format.
|
static |
Sign a message based on the private RSA key of the sender.
[in] | iPrivateKey | The private RSA key of the sender. |
[in] | iDigestType | The digest algorithm. |
[in] | iMsg | The message itself. |
[in] | iMsgLen | The size of the message. |
|
static |
Verify a message signature based on the public RSA of the sender.
[in] | iPublicKey | The public RSA key of the sender. |
[in] | iDigestType | The digest algorithm. |
[in] | iMsg | The message itself. |
[in] | iMsgLen | The size of the message. |
[in] | iSignature | The signature of the message. |
|
friend |
The '<<' operator for RSASignature.
Format: HexData
|
friend |
The '>>' operator for RSASignature.