client-cpp  0.6.1
kaa::KeyUtils Class Reference

#include <KeyUtils.hpp>

Public Member Functions

KeyPair generateKeyPair (std::size_t length)
 
Botan::SymmetricKey generateSessionKey (std::size_t length)
 

Static Public Member Functions

static Botan::MemoryVector
< std::uint8_t > 
loadPublicKey (const std::string &fileName)
 
static std::string 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 Botan::MemoryVector< std::uint8_t > &key, const std::string &pubFileName)
 
static void savePrivateKey (const std::string &key, const std::string &privFileName)
 

Detailed Description

Definition at line 31 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.
Botan::SymmetricKey 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 std::string kaa::KeyUtils::loadPrivateKey ( const std::string &  fileName)
static
static Botan::MemoryVector<std::uint8_t> 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 std::string &  key,
const std::string &  privFileName 
)
static
static void kaa::KeyUtils::savePublicKey ( const Botan::MemoryVector< std::uint8_t > &  key,
const std::string &  pubFileName 
)
static

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