6 #ifndef KAGOME_CRYPTO_KEY_FILE_STORAGE_HPP 7 #define KAGOME_CRYPTO_KEY_FILE_STORAGE_HPP 11 #include <boost/filesystem.hpp> 37 using Path = boost::filesystem::path;
45 static outcome::result<std::unique_ptr<KeyFileStorage>>
createAt(
59 KeyTypeId type, gsl::span<const uint8_t> public_key_bytes)
const;
66 gsl::span<const uint8_t> public_key,
67 gsl::span<const uint8_t> seed)
const;
86 const Path &path)
const;
94 std::string_view file_name)
const;
97 gsl::span<const uint8_t> public_key)
const;
107 #endif // KAGOME_CRYPTO_KEY_FILE_STORAGE_HPP
Class represents arbitrary (including empty) byte buffer.
outcome::result< void > initialize()
outcome::result< std::pair< KeyTypeId, Buffer > > parseKeyFileName(std::string_view file_name) const
outcome::result< std::vector< Buffer > > collectPublicKeys(KeyTypeId type) const
outcome::result< void > saveKeyPair(KeyTypeId type, gsl::span< const uint8_t > public_key, gsl::span< const uint8_t > seed) const
uint32_t KeyTypeId
Key type identifier.
SLBuffer< std::numeric_limits< size_t >::max()> Buffer
OUTCOME_HPP_DECLARE_ERROR(kagome::crypto, KeyFileStorage::Error)
std::shared_ptr< soralog::Logger > Logger
outcome::result< std::string > loadFileContent(const Path &file_path) const
outcome::result< void > saveKeyHexAtPath(gsl::span< const uint8_t > private_key, const Path &path) const
Path composeKeyPath(KeyTypeId key_type, gsl::span< const uint8_t > public_key) const
static outcome::result< std::unique_ptr< KeyFileStorage > > createAt(Path keystore_path)
outcome::result< std::optional< Buffer > > searchForSeed(KeyTypeId type, gsl::span< const uint8_t > public_key_bytes) const
boost::filesystem::path Path
KeyFileStorage(Path keystore_path)