Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
key_type.hpp
Go to the documentation of this file.
1
6
#ifndef KAGOME_CRYPTO_KEY_TYPE_HPP
7
#define KAGOME_CRYPTO_KEY_TYPE_HPP
8
9
#include "
outcome/outcome.hpp
"
10
11
namespace
kagome::crypto
{
12
13
enum class
KeyTypeError
{
14
UNSUPPORTED_KEY_TYPE
= 1,
15
UNSUPPORTED_KEY_TYPE_ID
,
16
};
17
21
using
KeyTypeId
= uint32_t;
22
27
enum
KnownKeyTypeId
:
KeyTypeId
{
28
// clang-format off
29
KEY_TYPE_BABE
= 0x65626162u,
// BABE, sr25519
30
KEY_TYPE_GRAN
= 0x6e617267u,
// GRANDPA, ed25519
31
KEY_TYPE_ACCO
= 0x6f636361u,
// Account control [sr25519, ed25519, secp256k1]
32
KEY_TYPE_IMON
= 0x6e6f6d69u,
// I'm Online, sr25519
33
KEY_TYPE_AUDI
= 0x69647561u,
// Account discovery [sr25519, ed25519, secp256k1]
34
KEY_TYPE_LP2P
= 0x7032706cu,
// LibP2P
35
KEY_TYPE_ASGN
= 0x6e677361u,
// ASGN
36
KEY_TYPE_PARA
= 0x61726170u,
// PARA
37
// clang-format on
38
};
39
45
std::string
encodeKeyTypeIdToStr
(
KeyTypeId
key_type_id);
46
52
KeyTypeId
decodeKeyTypeIdFromStr
(std::string_view str);
53
59
bool
isSupportedKeyType
(
KeyTypeId
k);
60
}
// namespace kagome::crypto
61
62
OUTCOME_HPP_DECLARE_ERROR
(
kagome::crypto
,
KeyTypeError
);
63
64
#endif // KAGOME_CRYPTO_KEY_TYPE_HPP
kagome::crypto::CryptoStoreError::UNSUPPORTED_KEY_TYPE
kagome::crypto::KEY_TYPE_AUDI
Definition:
key_type.hpp:33
kagome::crypto::KnownKeyTypeId
KnownKeyTypeId
Definition:
key_type.hpp:27
outcome.hpp
kagome::crypto::KEY_TYPE_ASGN
Definition:
key_type.hpp:35
kagome::crypto::KeyTypeId
uint32_t KeyTypeId
Key type identifier.
Definition:
key_type.hpp:21
kagome::crypto::KEY_TYPE_GRAN
Definition:
key_type.hpp:30
kagome::crypto::KEY_TYPE_BABE
Definition:
key_type.hpp:29
OUTCOME_HPP_DECLARE_ERROR
OUTCOME_HPP_DECLARE_ERROR(kagome::crypto, KeyTypeError)
kagome::crypto::KEY_TYPE_IMON
Definition:
key_type.hpp:32
kagome::crypto::encodeKeyTypeIdToStr
std::string encodeKeyTypeIdToStr(KeyTypeId key_type_id)
makes string representation of KeyTypeId
Definition:
key_type.cpp:29
kagome::crypto::KEY_TYPE_PARA
Definition:
key_type.hpp:36
kagome::crypto::isSupportedKeyType
bool isSupportedKeyType(KeyTypeId k)
checks whether key type value is supported
Definition:
key_type.cpp:14
kagome::crypto::KeyTypeError::UNSUPPORTED_KEY_TYPE_ID
kagome::crypto::KEY_TYPE_LP2P
Definition:
key_type.hpp:34
kagome::crypto
Definition:
author_api_impl.hpp:31
kagome::crypto::KeyTypeError
KeyTypeError
Definition:
key_type.hpp:13
kagome::crypto::KEY_TYPE_ACCO
Definition:
key_type.hpp:31
kagome::crypto::decodeKeyTypeIdFromStr
KeyTypeId decodeKeyTypeIdFromStr(std::string_view str)
restores KeyTypeId from its string representation
Definition:
key_type.cpp:35
core
crypto
crypto_store
key_type.hpp
Generated by
1.8.11