hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::KeysManagerImpl Class Reference

#include "keys_manager_impl.hpp"

Inheritance diagram for iroha::KeysManagerImpl:
Inheritance graph
Collaboration diagram for iroha::KeysManagerImpl:
Collaboration graph

Public Member Functions

 KeysManagerImpl (const std::string &account_id, const boost::filesystem::path &path_to_keypair, logger::LoggerPtr log)
 
 KeysManagerImpl (const std::string account_id, logger::LoggerPtr log)
 
bool createKeys () override
 
bool createKeys (const std::string &pass_phrase) override
 
boost::optional< shared_model::crypto::KeypairloadKeys () override
 
boost::optional< shared_model::crypto::KeypairloadKeys (const std::string &pass_phrase) override
 
- Public Member Functions inherited from iroha::KeysManager
virtual ~KeysManager ()=default
 

Static Public Attributes

static const std::string kPublicKeyExtension = ".pub"
 
static const std::string kPrivateKeyExtension = ".priv"
 

Constructor & Destructor Documentation

iroha::KeysManagerImpl::KeysManagerImpl ( const std::string &  account_id,
const boost::filesystem::path &  path_to_keypair,
logger::LoggerPtr  log 
)

Initialize key manager for a specific account

Parameters
account_id- fully qualified account id, e.g. admin
Test:
Parameters
path_to_keypair- path to directory that contains priv and pub key of an account
logto print progress
iroha::KeysManagerImpl::KeysManagerImpl ( const std::string  account_id,
logger::LoggerPtr  log 
)

Initialize key manager for a specific account

Parameters
account_id- fully qualified account id, e.g. admin
Test:
Parameters
logto print progress

Here we use an empty string as a default value of path to file, since there are usages of KeysManagerImpl with path passed as a part of account_id.

Here is the call graph for this function:

Member Function Documentation

bool iroha::KeysManagerImpl::createKeys ( )
overridevirtual

Create keys of a new keypair and store them on disk

Returns
false if keys creation was failed

Implements iroha::KeysManager.

Here is the caller graph for this function:

bool iroha::KeysManagerImpl::createKeys ( const std::string &  pass_phrase)
overridevirtual

Create keys of a new keypair and store it encrypted on disk

Parameters
pass_phraseis used for private key encryption
Returns
false if keys creation was failed

Implements iroha::KeysManager.

Here is the call graph for this function:

boost::optional< Keypair > iroha::KeysManagerImpl::loadKeys ( )
overridevirtual

Load keys associated with the manager, then validate loaded keypair by signing and verifying the signature of a test message

Returns
nullopt if no keypair found locally, or in case of verification failure. Otherwise - the keypair will be returned

Implements iroha::KeysManager.

Here is the caller graph for this function:

boost::optional< Keypair > iroha::KeysManagerImpl::loadKeys ( const std::string &  pass_phrase)
overridevirtual

Load encrypted keys associated with the manager, then validate loaded keypair by signing and verifying the signature of a test message

Parameters
pass_phraseis a password for decryption
Returns
nullopt if no keypair found locally, or in case of verification failure. Otherwise - the keypair will be returned

Implements iroha::KeysManager.

Here is the call graph for this function:

Member Data Documentation

const std::string iroha::KeysManagerImpl::kPrivateKeyExtension = ".priv"
static
const std::string iroha::KeysManagerImpl::kPublicKeyExtension = ".pub"
static

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