Kagome
Polkadot Runtime Engine in C++17
kagome::crypto::CryptoStore Class Referenceabstract

#include <crypto_store.hpp>

Inheritance diagram for kagome::crypto::CryptoStore:
Collaboration diagram for kagome::crypto::CryptoStore:

Public Types

using Path = boost::filesystem::path
 
using EcdsaKeys = std::vector< EcdsaPublicKey >
 
using Ed25519Keys = std::vector< Ed25519PublicKey >
 
using Sr25519Keys = std::vector< Sr25519PublicKey >
 
using EcdsaKeypairs = std::vector< EcdsaKeypair >
 
using Ed25519Keypairs = std::vector< Ed25519Keypair >
 
using Sr25519Keypairs = std::vector< Sr25519Keypair >
 

Public Member Functions

virtual ~CryptoStore ()=default
 
virtual outcome::result< EcdsaKeypairgenerateEcdsaKeypair (KeyTypeId key_type, std::string_view mnemonic_phrase)=0
 generates ecdsa keypair and stores it in memory More...
 
virtual outcome::result< Ed25519KeypairgenerateEd25519Keypair (KeyTypeId key_type, std::string_view mnemonic_phrase)=0
 generates Ed25519 keypair and stores it in memory More...
 
virtual outcome::result< Sr25519KeypairgenerateSr25519Keypair (KeyTypeId key_type, std::string_view mnemonic_phrase)=0
 generates SR25519 keypair and stores it in memory More...
 
virtual outcome::result< EcdsaKeypairgenerateEcdsaKeypair (KeyTypeId key_type, const EcdsaSeed &seed)=0
 generates ecdsa keypair and stores it in memory More...
 
virtual outcome::result< Ed25519KeypairgenerateEd25519Keypair (KeyTypeId key_type, const Ed25519Seed &seed)=0
 generates Ed25519 keypair and stores it in memory More...
 
virtual outcome::result< Sr25519KeypairgenerateSr25519Keypair (KeyTypeId key_type, const Sr25519Seed &seed)=0
 generates SR25519 keypair and stores it in memory More...
 
virtual outcome::result< EcdsaKeypairgenerateEcdsaKeypairOnDisk (KeyTypeId key_type)=0
 generates ecdsa keypair and stores it on disk More...
 
virtual outcome::result< Ed25519KeypairgenerateEd25519KeypairOnDisk (KeyTypeId key_type)=0
 generates Ed25519 keypair and stores it on disk More...
 
virtual outcome::result< Sr25519KeypairgenerateSr25519KeypairOnDisk (KeyTypeId key_type)=0
 generates SR25519 keypair and stores it on disk More...
 
virtual outcome::result< EcdsaKeypairfindEcdsaKeypair (KeyTypeId key_type, const EcdsaPublicKey &pk) const =0
 searches for key pair More...
 
virtual outcome::result< Ed25519KeypairfindEd25519Keypair (KeyTypeId key_type, const Ed25519PublicKey &pk) const =0
 searches for key pair More...
 
virtual outcome::result< Sr25519KeypairfindSr25519Keypair (KeyTypeId key_type, const Sr25519PublicKey &pk) const =0
 searches for key pair More...
 
virtual outcome::result< EcdsaKeysgetEcdsaPublicKeys (KeyTypeId key_type) const =0
 searches for ecdsa keys of specified type More...
 
virtual outcome::result< Ed25519KeysgetEd25519PublicKeys (KeyTypeId key_type) const =0
 searches for Ed25519 keys of specified type More...
 
virtual outcome::result< Sr25519KeysgetSr25519PublicKeys (KeyTypeId key_type) const =0
 searches for SR25519 keys of specified type More...
 
virtual std::optional< libp2p::crypto::KeyPair > getLibp2pKeypair () const =0
 
virtual outcome::result< libp2p::crypto::KeyPair > loadLibp2pKeypair (const Path &key_path) const =0
 

Detailed Description

Definition at line 23 of file crypto_store.hpp.

Member Typedef Documentation

Definition at line 34 of file crypto_store.hpp.

using kagome::crypto::CryptoStore::EcdsaKeys = std::vector<EcdsaPublicKey>

Definition at line 31 of file crypto_store.hpp.

Definition at line 35 of file crypto_store.hpp.

using kagome::crypto::CryptoStore::Ed25519Keys = std::vector<Ed25519PublicKey>

Definition at line 32 of file crypto_store.hpp.

using kagome::crypto::CryptoStore::Path = boost::filesystem::path

Definition at line 27 of file crypto_store.hpp.

Definition at line 36 of file crypto_store.hpp.

using kagome::crypto::CryptoStore::Sr25519Keys = std::vector<Sr25519PublicKey>

Definition at line 33 of file crypto_store.hpp.

Constructor & Destructor Documentation

virtual kagome::crypto::CryptoStore::~CryptoStore ( )
virtualdefault

Member Function Documentation

virtual outcome::result<EcdsaKeypair> kagome::crypto::CryptoStore::findEcdsaKeypair ( KeyTypeId  key_type,
const EcdsaPublicKey &  pk 
) const
pure virtual

searches for key pair

Parameters
key_typekey category
pkpublic key to look for
Returns
found key pair if exists

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Ed25519Keypair> kagome::crypto::CryptoStore::findEd25519Keypair ( KeyTypeId  key_type,
const Ed25519PublicKey &  pk 
) const
pure virtual

searches for key pair

Parameters
key_typekey category
pkpublic key to look for
Returns
found key pair if exists

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Sr25519Keypair> kagome::crypto::CryptoStore::findSr25519Keypair ( KeyTypeId  key_type,
const Sr25519PublicKey &  pk 
) const
pure virtual

searches for key pair

Parameters
key_typekey category
pkpublic key to look for
Returns
found key pair if exists

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<EcdsaKeypair> kagome::crypto::CryptoStore::generateEcdsaKeypair ( KeyTypeId  key_type,
std::string_view  mnemonic_phrase 
)
pure virtual

generates ecdsa keypair and stores it in memory

Parameters
key_typekey type identifier
mnemonic_phrasemnemonic phrase
Returns
generated key pair or error

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<EcdsaKeypair> kagome::crypto::CryptoStore::generateEcdsaKeypair ( KeyTypeId  key_type,
const EcdsaSeed seed 
)
pure virtual

generates ecdsa keypair and stores it in memory

Parameters
key_typekey type identifier
seedseed for generating keys
Returns
generated key pair

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<EcdsaKeypair> kagome::crypto::CryptoStore::generateEcdsaKeypairOnDisk ( KeyTypeId  key_type)
pure virtual

generates ecdsa keypair and stores it on disk

Parameters
key_typekey type identifier
Returns
generated key pair or error

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Ed25519Keypair> kagome::crypto::CryptoStore::generateEd25519Keypair ( KeyTypeId  key_type,
std::string_view  mnemonic_phrase 
)
pure virtual

generates Ed25519 keypair and stores it in memory

Parameters
key_typekey type identifier
mnemonic_phrasemnemonic phrase
Returns
generated key pair or error

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Ed25519Keypair> kagome::crypto::CryptoStore::generateEd25519Keypair ( KeyTypeId  key_type,
const Ed25519Seed &  seed 
)
pure virtual

generates Ed25519 keypair and stores it in memory

Parameters
key_typekey type identifier
seedseed for generating keys
Returns
generated key pair

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Ed25519Keypair> kagome::crypto::CryptoStore::generateEd25519KeypairOnDisk ( KeyTypeId  key_type)
pure virtual

generates Ed25519 keypair and stores it on disk

Parameters
key_typekey type identifier
Returns
generated key pair or error

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Sr25519Keypair> kagome::crypto::CryptoStore::generateSr25519Keypair ( KeyTypeId  key_type,
std::string_view  mnemonic_phrase 
)
pure virtual

generates SR25519 keypair and stores it in memory

Parameters
key_typekey type identifier
mnemonic_phrasemnemonic phrase
Returns
generated key pair or error

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Sr25519Keypair> kagome::crypto::CryptoStore::generateSr25519Keypair ( KeyTypeId  key_type,
const Sr25519Seed &  seed 
)
pure virtual

generates SR25519 keypair and stores it in memory

Parameters
key_typekey type identifier
seedseed for generating keys
Returns
generated key

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Sr25519Keypair> kagome::crypto::CryptoStore::generateSr25519KeypairOnDisk ( KeyTypeId  key_type)
pure virtual

generates SR25519 keypair and stores it on disk

Parameters
key_typekey type identifier
Returns
generated key pair or error

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<EcdsaKeys> kagome::crypto::CryptoStore::getEcdsaPublicKeys ( KeyTypeId  key_type) const
pure virtual

searches for ecdsa keys of specified type

Parameters
key_typekey type identifier to look for
Returns
vector of found public keys

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Ed25519Keys> kagome::crypto::CryptoStore::getEd25519PublicKeys ( KeyTypeId  key_type) const
pure virtual

searches for Ed25519 keys of specified type

Parameters
key_typekey type identifier to look for
Returns
vector of found public keys

Implemented in kagome::crypto::CryptoStoreImpl.

virtual std::optional<libp2p::crypto::KeyPair> kagome::crypto::CryptoStore::getLibp2pKeypair ( ) const
pure virtual
Returns
current LibP2P keypair

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<Sr25519Keys> kagome::crypto::CryptoStore::getSr25519PublicKeys ( KeyTypeId  key_type) const
pure virtual

searches for SR25519 keys of specified type

Parameters
key_typekey type identifier to look for
Returns
vector of found public keys

Implemented in kagome::crypto::CryptoStoreImpl.

virtual outcome::result<libp2p::crypto::KeyPair> kagome::crypto::CryptoStore::loadLibp2pKeypair ( const Path key_path) const
pure virtual

Acquires the key from user-provided path or generates and saves the key under the path. Used when –node-key-file flag gets processed.

Parameters
path- path the key file (raw bytes or hex-encoded)
Returns
LibP2P keypair

Implemented in kagome::crypto::CryptoStoreImpl.


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