Skip to content

sgns::crypto::CryptoStore

#include <crypto_store.hpp>

Inherited by sgns::crypto::CryptoStoreImpl

Public Types

Name
using boost::filesystem::path Path
using std::vector< ED25519PublicKey > ED25519Keys
using std::vector< SR25519PublicKey > SR25519Keys

Public Functions

Name
virtual ~CryptoStore() =default
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< SR25519Keypair > generateSr25519Keypair(KeyTypeId key_type, std::string_view mnemonic_phrase) =0
generates SR25519 keypair and stores it in memory
virtual ED25519Keypair generateEd25519Keypair(KeyTypeId key_type, const ED25519Seed & seed) =0
generates ED25519 keypair and stores it in memory
virtual SR25519Keypair generateSr25519Keypair(KeyTypeId key_type, const SR25519Seed & seed) =0
generates SR25519 keypair and stores it in memory
virtual outcome::result< ED25519Keypair > generateEd25519Keypair(KeyTypeId key_type) =0
generates ED25519 keypair and stores it on disk
virtual outcome::result< SR25519Keypair > generateSr25519Keypair(KeyTypeId key_type) =0
generates SR25519 keypair and stores it on disk
virtual outcome::result< ED25519Keypair > findEd25519Keypair(KeyTypeId key_type, const ED25519PublicKey & pk) const =0
searches for key pair
virtual outcome::result< SR25519Keypair > findSr25519Keypair(KeyTypeId key_type, const SR25519PublicKey & pk) const =0
searches for key pair
virtual ED25519Keys getEd25519PublicKeys(KeyTypeId key_type) const =0
searches for ED25519 keys of specified type
virtual SR25519Keys getSr25519PublicKeys(KeyTypeId key_type) const =0
searches for SR25519 keys of specified typeED

Public Types Documentation

using Path

using sgns::crypto::CryptoStore::Path = boost::filesystem::path;

using ED25519Keys

using sgns::crypto::CryptoStore::ED25519Keys = std::vector<ED25519PublicKey>;

using SR25519Keys

using sgns::crypto::CryptoStore::SR25519Keys = std::vector<SR25519PublicKey>;

Public Functions Documentation

function ~CryptoStore

virtual ~CryptoStore() =default

function generateEd25519Keypair

virtual outcome::result< ED25519Keypair > generateEd25519Keypair(
    KeyTypeId key_type,
    std::string_view mnemonic_phrase
) =0

generates ED25519 keypair and stores it in memory

Parameters:

  • key_type key type identifier
  • mnemonic_phrase mnemonic phrase

Return: generated key pair or error

Reimplemented by: sgns::crypto::CryptoStoreImpl::generateEd25519Keypair

function generateSr25519Keypair

virtual outcome::result< SR25519Keypair > generateSr25519Keypair(
    KeyTypeId key_type,
    std::string_view mnemonic_phrase
) =0

generates SR25519 keypair and stores it in memory

Parameters:

  • key_type key type identifier
  • mnemonic_phrase mnemonic phrase

Return: generated key pair or error

Reimplemented by: sgns::crypto::CryptoStoreImpl::generateSr25519Keypair

function generateEd25519Keypair

virtual ED25519Keypair generateEd25519Keypair(
    KeyTypeId key_type,
    const ED25519Seed & seed
) =0

generates ED25519 keypair and stores it in memory

Parameters:

  • key_type key type identifier
  • seed seed for generating keys

Return: generated key pair

Reimplemented by: sgns::crypto::CryptoStoreImpl::generateEd25519Keypair

function generateSr25519Keypair

virtual SR25519Keypair generateSr25519Keypair(
    KeyTypeId key_type,
    const SR25519Seed & seed
) =0

generates SR25519 keypair and stores it in memory

Parameters:

  • key_type key type identifier
  • seed seed for generating keys

Return: generated key

Reimplemented by: sgns::crypto::CryptoStoreImpl::generateSr25519Keypair

function generateEd25519Keypair

virtual outcome::result< ED25519Keypair > generateEd25519Keypair(
    KeyTypeId key_type
) =0

generates ED25519 keypair and stores it on disk

Parameters:

  • key_type key type identifier

Return: generated key pair or error

Reimplemented by: sgns::crypto::CryptoStoreImpl::generateEd25519Keypair

function generateSr25519Keypair

virtual outcome::result< SR25519Keypair > generateSr25519Keypair(
    KeyTypeId key_type
) =0

generates SR25519 keypair and stores it on disk

Parameters:

  • key_type key type identifier

Return: generated key pair or error

Reimplemented by: sgns::crypto::CryptoStoreImpl::generateSr25519Keypair

function findEd25519Keypair

virtual outcome::result< ED25519Keypair > findEd25519Keypair(
    KeyTypeId key_type,
    const ED25519PublicKey & pk
) const =0

searches for key pair

Parameters:

  • key_type key category
  • pk public key to look for

Return: found key pair if exists

Reimplemented by: sgns::crypto::CryptoStoreImpl::findEd25519Keypair

function findSr25519Keypair

virtual outcome::result< SR25519Keypair > findSr25519Keypair(
    KeyTypeId key_type,
    const SR25519PublicKey & pk
) const =0

searches for key pair

Parameters:

  • key_type key category
  • pk public key to look for

Return: found key pair if exists

Reimplemented by: sgns::crypto::CryptoStoreImpl::findSr25519Keypair

function getEd25519PublicKeys

virtual ED25519Keys getEd25519PublicKeys(
    KeyTypeId key_type
) const =0

searches for ED25519 keys of specified type

Parameters:

  • key_type key type identifier to look for

Return: vector of found public keys

Reimplemented by: sgns::crypto::CryptoStoreImpl::getEd25519PublicKeys

function getSr25519PublicKeys

virtual SR25519Keys getSr25519PublicKeys(
    KeyTypeId key_type
) const =0

searches for SR25519 keys of specified typeED

Parameters:

  • key_type key type identifier to look for

Return: vector of found public keys

Reimplemented by: sgns::crypto::CryptoStoreImpl::getSr25519PublicKeys


Updated on 2026-03-04 at 13:10:43 -0800