6 #ifndef KAGOME_CRYPTO_STORE_HPP 7 #define KAGOME_CRYPTO_STORE_HPP 11 #include <boost/filesystem.hpp> 12 #include <libp2p/crypto/key.hpp> 27 using Path = boost::filesystem::path;
45 KeyTypeId key_type, std::string_view mnemonic_phrase) = 0;
54 KeyTypeId key_type, std::string_view mnemonic_phrase) = 0;
63 KeyTypeId key_type, std::string_view mnemonic_phrase) = 0;
81 KeyTypeId key_type,
const Ed25519Seed &seed) = 0;
90 KeyTypeId key_type,
const Sr25519Seed &seed) = 0;
123 KeyTypeId key_type,
const EcdsaPublicKey &pk)
const = 0;
132 KeyTypeId key_type,
const Ed25519PublicKey &pk)
const = 0;
141 KeyTypeId key_type,
const Sr25519PublicKey &pk)
const = 0;
170 virtual std::optional<libp2p::crypto::KeyPair>
getLibp2pKeypair()
const = 0;
179 const Path &key_path)
const = 0;
183 #endif // KAGOME_CRYPTO_STORE_HPP virtual outcome::result< EcdsaKeypair > generateEcdsaKeypairOnDisk(KeyTypeId key_type)=0
generates ecdsa keypair and stores it on disk
virtual std::optional< libp2p::crypto::KeyPair > getLibp2pKeypair() const =0
virtual outcome::result< EcdsaKeypair > generateEcdsaKeypair(KeyTypeId key_type, std::string_view mnemonic_phrase)=0
generates ecdsa keypair and stores it in memory
boost::filesystem::path Path
virtual outcome::result< Ed25519Keypair > findEd25519Keypair(KeyTypeId key_type, const Ed25519PublicKey &pk) const =0
searches for key pair
std::vector< Ed25519Keypair > Ed25519Keypairs
virtual outcome::result< Sr25519Keypair > findSr25519Keypair(KeyTypeId key_type, const Sr25519PublicKey &pk) const =0
searches for key pair
virtual outcome::result< Ed25519Keys > getEd25519PublicKeys(KeyTypeId key_type) const =0
searches for Ed25519 keys of specified type
uint32_t KeyTypeId
Key type identifier.
virtual outcome::result< Sr25519Keys > getSr25519PublicKeys(KeyTypeId key_type) const =0
searches for SR25519 keys of specified type
virtual outcome::result< EcdsaKeys > getEcdsaPublicKeys(KeyTypeId key_type) const =0
searches for ecdsa keys of specified type
virtual outcome::result< Ed25519Keypair > generateEd25519Keypair(KeyTypeId key_type, std::string_view mnemonic_phrase)=0
generates Ed25519 keypair and stores it in memory
virtual outcome::result< libp2p::crypto::KeyPair > loadLibp2pKeypair(const Path &key_path) const =0
virtual outcome::result< EcdsaKeypair > findEcdsaKeypair(KeyTypeId key_type, const EcdsaPublicKey &pk) const =0
searches for key pair
std::vector< Ed25519PublicKey > Ed25519Keys
virtual outcome::result< Sr25519Keypair > generateSr25519KeypairOnDisk(KeyTypeId key_type)=0
generates SR25519 keypair and stores it on disk
virtual outcome::result< Sr25519Keypair > generateSr25519Keypair(KeyTypeId key_type, std::string_view mnemonic_phrase)=0
generates SR25519 keypair and stores it in memory
std::vector< EcdsaPublicKey > EcdsaKeys
virtual ~CryptoStore()=default
std::vector< Sr25519Keypair > Sr25519Keypairs
std::vector< Sr25519PublicKey > Sr25519Keys
virtual outcome::result< Ed25519Keypair > generateEd25519KeypairOnDisk(KeyTypeId key_type)=0
generates Ed25519 keypair and stores it on disk
std::vector< EcdsaKeypair > EcdsaKeypairs