#include <RSACrypter.h>
Public Member Functions | |
| TRSACrypter () | |
| Retval | decode (const TypePrivateRSAKey &rKey, const IByteArray &rInput, IByteArray &rOutput) |
| Retval | encode (const TypePublicRSAKey &rKey, const IByteArray &rInput, IByteArray &rOutput) |
| Retval | sign (const TypePrivateRSAKey &rKey, const IByteArray &rInput, IByteArray &rOutput) |
| Retval | verify (const TypePublicRSAKey &rKey, const IByteArray &rInput, IByteArray &rOutput) |
Static Public Member Functions | |
| static void | generateComponents (const Int1024 &ri1024P, const Int1024 &ri1024Q, const Int1024 &ri1024E, TypePublicRSAKey &rPublicKey, TypePrivateRSAKey &rPrivateKey) |
Protected Types | |
| enum | EPaddingMethod { etNone = 0, etPKCS7 = 1, etZeros = 2, etANSIX923 = 3, etISO10126 = 4 } |
Protected Member Functions | |
| Int1024 | encode_CRT (const TypePrivateRSAKey &rKey, const Int1024 &ri1024Base) const |
The class implements the encryption and decryption using the RSA algorithm. The RSA uses a public and private key for encryption.
enum zeus::TRSACrypter::EPaddingMethod [protected] |
Padding methods
| TRSACrypter::TRSACrypter | ( | ) |
Creates a RSA crypter
| Retval TRSACrypter::decode | ( | const TypePrivateRSAKey & | rKey, |
| const IByteArray & | rInput, | ||
| IByteArray & | rOutput | ||
| ) |
decodes the data using the private key
| Retval TRSACrypter::encode | ( | const TypePublicRSAKey & | rKey, |
| const IByteArray & | rInput, | ||
| IByteArray & | rOutput | ||
| ) |
encodes data with the public key
| Int1024 TRSACrypter::encode_CRT | ( | const TypePrivateRSAKey & | rKey, |
| const Int1024 & | ri1024Base | ||
| ) | const [protected] |
encodes the data using the private key. The Chinese Remainder Theorem (CRT) is used to calculate the clear text (or signing the message)
| rKey | : private key |
| rBase | : base value |
| void TRSACrypter::generateComponents | ( | const Int1024 & | ri1024_P, |
| const Int1024 & | ri1024_Q, | ||
| const Int1024 & | ri1024_E, | ||
| TypePublicRSAKey & | rPublicKey, | ||
| TypePrivateRSAKey & | rPrivateKey | ||
| ) | [static] |
Generates the keys
| Retval TRSACrypter::sign | ( | const TypePrivateRSAKey & | rKey, |
| const IByteArray & | rInput, | ||
| IByteArray & | rOutput | ||
| ) |
signing the data using the private key
| Retval TRSACrypter::verify | ( | const TypePublicRSAKey & | rKey, |
| const IByteArray & | rInput, | ||
| IByteArray & | rOutput | ||
| ) |
verifies the data using the public key