All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Static Public Member Functions | List of all members
ndn::RsaAlgorithm Class Reference

The RsaAlgorithm class provides static methods to manipulate keys, encrypt and decrypt using RSA. More...

#include <rsa-algorithm.hpp>

Static Public Member Functions

static DecryptKey generateKey (const RsaKeyParams &params)
 Generate a new random decrypt key for RSA based on the given params. More...
 
static EncryptKey deriveEncryptKey (const Blob &keyBits)
 Derive a new encrypt key from the given decrypt key value. More...
 
static Blob decrypt (const Blob &keyBits, const Blob &encryptedData, const EncryptParams &params)
 Decrypt the encryptedData using the keyBits according the encrypt params. More...
 
static Blob encrypt (const Blob &keyBits, const Blob &plainData, const EncryptParams &params)
 Encrypt the plainData using the keyBits according the encrypt params. More...
 

Detailed Description

The RsaAlgorithm class provides static methods to manipulate keys, encrypt and decrypt using RSA.

Note
This class is an experimental feature. The API may change.

Member Function Documentation

static Blob ndn::RsaAlgorithm::decrypt ( const Blob keyBits,
const Blob encryptedData,
const EncryptParams params 
)
static

Decrypt the encryptedData using the keyBits according the encrypt params.

Parameters
keyBitsThe key value (PKCS8-encoded private key).
encryptedDataThe data to decrypt.
paramsThis decrypts according to params.getAlgorithmType().
Returns
The decrypted data.
EncryptKey ndn::RsaAlgorithm::deriveEncryptKey ( const Blob keyBits)
static

Derive a new encrypt key from the given decrypt key value.

Parameters
keyBitsThe key value of the decrypt key (PKCS8-encoded private key).
Returns
The new encrypt key (DER-encoded public key).
static Blob ndn::RsaAlgorithm::encrypt ( const Blob keyBits,
const Blob plainData,
const EncryptParams params 
)
static

Encrypt the plainData using the keyBits according the encrypt params.

Parameters
keyBitsThe key value (DER-encoded public key).
plainDataThe data to encrypt.
paramsThis encrypts according to params.getAlgorithmType().
Returns
The encrypted data.
DecryptKey ndn::RsaAlgorithm::generateKey ( const RsaKeyParams params)
static

Generate a new random decrypt key for RSA based on the given params.

Parameters
paramsThe key params with the key size (in bits).
Returns
The new decrypt key (PKCS8-encoded private key).

The documentation for this class was generated from the following files: