client-cpp  0.6.3
kaa::KeyUtils Class Reference

#include <KeyUtils.hpp>

Public Member Functions

KeyPair generateKeyPair (std::size_t length)
 
SessionKey generateSessionKey (std::size_t length)
 

Static Public Member Functions

static PublicKey loadPublicKey (const std::string &fileName)
 
static PrivateKey loadPrivateKey (const std::string &fileName)
 
static KeyPair loadKeyPair (const std::string &pubFileName, const std::string &privFileName)
 
static void saveKeyPair (const KeyPair &pair, const std::string &pubFileName, const std::string &privFileName)
 
static void savePublicKey (const PublicKey &key, const std::string &pubFileName)
 
static void savePrivateKey (const PrivateKey &key, const std::string &privFileName)
 

Detailed Description

Definition at line 30 of file KeyUtils.hpp.

Member Function Documentation

KeyPair kaa::KeyUtils::generateKeyPair ( std::size_t  length)

Generates RSA private and public keys.

Parameters
lengththe length of the key in bits
Returns
the pair of keys. The first element of the pair is a public key and the second one - is a private key.
SessionKey kaa::KeyUtils::generateSessionKey ( std::size_t  length)

Generates symmetric session key

Parameters
lengththe length of the key in bytes
Returns
the pair of key and initialization vector
static KeyPair kaa::KeyUtils::loadKeyPair ( const std::string &  pubFileName,
const std::string &  privFileName 
)
static
static PrivateKey kaa::KeyUtils::loadPrivateKey ( const std::string &  fileName)
static
static PublicKey kaa::KeyUtils::loadPublicKey ( const std::string &  fileName)
static
static void kaa::KeyUtils::saveKeyPair ( const KeyPair pair,
const std::string &  pubFileName,
const std::string &  privFileName 
)
static
static void kaa::KeyUtils::savePrivateKey ( const PrivateKey key,
const std::string &  privFileName 
)
static
static void kaa::KeyUtils::savePublicKey ( const PublicKey key,
const std::string &  pubFileName 
)
static

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