RSA private key object.
More...
#include "SuperpoweredRSA.h"
|
| ~RSAPrivateKey () |
| Destructor. More...
|
|
unsigned char * | decrypt (void *encrypted, unsigned int *decryptedSizeBytes, bool OAEP_PSS_V21) |
| RSA decryption with private key. More...
|
|
bool | isPair (RSAPublicKey *publicKey) |
| Checks if a public key is the pair of this private key. More...
|
|
unsigned char * | sign (hashType alg, unsigned int inputLengthBytes, void *input, bool OAEP_PSS_V21) |
| Creates an RSA signature. More...
|
|
unsigned char * | signHash (hashType alg, unsigned int hashLengthBytes, const unsigned char *hash, bool OAEP_PSS_V21) |
| Creates an RSA signature. More...
|
|
◆ ~RSAPrivateKey()
Superpowered::RSAPrivateKey::~RSAPrivateKey |
( |
| ) |
|
◆ RSAPrivateKey()
Superpowered::RSAPrivateKey::RSAPrivateKey |
( |
void * |
| ) |
|
|
private |
◆ createFromDER()
static RSAPrivateKey* Superpowered::RSAPrivateKey::createFromDER |
( |
const unsigned char * |
der, |
|
|
unsigned int |
derLengthBytes |
|
) |
| |
|
static |
Creates an RSA private key object from DER data.
- Parameters
-
der | DER data. |
derLengthBytes | DER data length in bytes. |
- Returns
- The new RSA private key object or NULL on memory allocation error or invalid DER data.
◆ createFromPEM()
static RSAPrivateKey* Superpowered::RSAPrivateKey::createFromPEM |
( |
const char * |
pem, |
|
|
unsigned int |
pemLengthBytes |
|
) |
| |
|
static |
Creates an RSA private key object from a PEM string.
- Parameters
-
pem | PEM string. |
pemLengthBytes | PEM string length (not including the trailing zero if any). |
- Returns
- The new RSA private key object or NULL on memory allocation error or invalid PEM data.
◆ decrypt()
unsigned char* Superpowered::RSAPrivateKey::decrypt |
( |
void * |
encrypted, |
|
|
unsigned int * |
decryptedSizeBytes, |
|
|
bool |
OAEP_PSS_V21 |
|
) |
| |
RSA decryption with private key.
- Parameters
-
encrypted | Encrypted input data. |
decryptedSizeBytes | The length of the decrypted (output) data in bytes. |
OAEP_PSS_V21 | True for OAEP PSS v2.1, false for PKCS1 v1.5. |
- Returns
- Decrypted data or NULL on error. Don't forget to free() this at a later point to prevent memory leaks!
◆ isPair()
bool Superpowered::RSAPrivateKey::isPair |
( |
RSAPublicKey * |
publicKey | ) |
|
Checks if a public key is the pair of this private key.
- Parameters
-
publicKey | The public key object. |
- Returns
- True if the public key is the pair of this private key, false otherwise.
◆ sign()
unsigned char* Superpowered::RSAPrivateKey::sign |
( |
hashType |
alg, |
|
|
unsigned int |
inputLengthBytes, |
|
|
void * |
input, |
|
|
bool |
OAEP_PSS_V21 |
|
) |
| |
Creates an RSA signature.
- Parameters
-
alg | The hashing algorithm to use. |
inputLengthBytes | The length of input in bytes. |
input | Input data. |
OAEP_PSS_V21 | True for OAEP PSS v2.1, false for PKCS1 v1.5. |
- Returns
- Signature string or NULL on error. Don't forget to free() this at a later point to prevent memory leaks!
◆ signHash()
unsigned char* Superpowered::RSAPrivateKey::signHash |
( |
hashType |
alg, |
|
|
unsigned int |
hashLengthBytes, |
|
|
const unsigned char * |
hash, |
|
|
bool |
OAEP_PSS_V21 |
|
) |
| |
Creates an RSA signature.
- Parameters
-
alg | The hashing algorithm to use. |
hashLengthBytes | The length of hash in bytes. |
hash | Hash data. |
OAEP_PSS_V21 | True for OAEP PSS v2.1, false for PKCS1 v1.5. |
- Returns
- Signature string or NULL on error. Don't forget to free() this at a later point to prevent memory leaks!
◆ internals
RSAContext* Superpowered::RSAPrivateKey::internals |
|
private |
The documentation for this class was generated from the following file:
- latest/Superpowered/SuperpoweredRSA.h