Skip to content

src/crypto/crypto_store/key_type.hpp

Namespaces

Name
sgns
sgns::crypto
sgns::crypto::key_types

Types

Name
enum class KeyTypeError
using uint32_t KeyTypeId
Key type identifier.

Functions

Name
std::string decodeKeyTypeId(KeyTypeId param)
makes string representation of KeyTypeId
bool isSupportedKeyType(KeyTypeId k)
checks whether key type value is supported
OUTCOME_HPP_DECLARE_ERROR_2(sgns::crypto , KeyTypeError )

Attributes

Name
KeyTypeId kProd
KeyTypeId kGran
KeyTypeId kAcco
KeyTypeId kImon
KeyTypeId kAudi
KeyTypeId kLp2p

Types Documentation

enum KeyTypeError

Enumerator Value Description
UNSUPPORTED_KEY_TYPE 1
UNSUPPORTED_KEY_TYPE_ID

using KeyTypeId

using sgns::crypto::KeyTypeId = uint32_t;

Key type identifier.

Functions Documentation

function decodeKeyTypeId

std::string decodeKeyTypeId(
    KeyTypeId param
)

makes string representation of KeyTypeId

Parameters:

  • param param key type

Return: string representation of key type value

function isSupportedKeyType

bool isSupportedKeyType(
    KeyTypeId k
)

checks whether key type value is supported

Parameters:

  • k key type value

Return: true if supported, false otherwise

function OUTCOME_HPP_DECLARE_ERROR_2

OUTCOME_HPP_DECLARE_ERROR_2(
    sgns::crypto ,
    KeyTypeError 
)

Attributes Documentation

variable kProd

static KeyTypeId kProd = 1886547812U;

Types are 32bit integers, which represent encoded 4-char strings Big-endian byte order is used

variable kGran

static KeyTypeId kGran = 1735549294U;

variable kAcco

static KeyTypeId kAcco = 1633903471U;

variable kImon

static KeyTypeId kImon = 1768779630U;

variable kAudi

static KeyTypeId kAudi = 1635083369U;

variable kLp2p

static KeyTypeId kLp2p = 1819292272U;

Source code

#ifndef SUPERGENIUS_CRYPTO_KEY_TYPE_HPP
#define SUPERGENIUS_CRYPTO_KEY_TYPE_HPP

#include "outcome/outcome.hpp"

namespace sgns::crypto {
  enum class KeyTypeError {
    UNSUPPORTED_KEY_TYPE = 1,
    UNSUPPORTED_KEY_TYPE_ID,
  };

  using KeyTypeId = uint32_t;

  namespace key_types {
    static constexpr KeyTypeId kProd = 1886547812U; // "prod"
    static constexpr KeyTypeId kGran = 1735549294U; // "gran"
    static constexpr KeyTypeId kAcco = 1633903471U; // "acco"
    static constexpr KeyTypeId kImon = 1768779630U; // "imon"
    static constexpr KeyTypeId kAudi = 1635083369U; // "audi"
    static constexpr KeyTypeId kLp2p = 1819292272U; // "lp2p"
  }  // namespace supported_key_types

  std::string decodeKeyTypeId(KeyTypeId param);

  bool isSupportedKeyType(KeyTypeId k);
}  // namespace sgns::crypto

OUTCOME_HPP_DECLARE_ERROR_2(sgns::crypto, KeyTypeError);

#endif  // SUPERGENIUS_CRYPTO_KEY_TYPE_HPP

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