sgns::GeniusSigner¶
Owns a Genius keypair without imposing account persistence or lifecycle concerns. More...
#include <GeniusSigner.hpp>
Public Types¶
| Name | |
|---|---|
| using std::array< uint8_t, PRIVATE_KEY_SIZE > | PrivateKey Big-endian secp256k1 secret key, matching libsecp256k1's own encoding. |
Public Functions¶
| Name | |
|---|---|
| GeniusSigner | Generate() Generate a fresh, in-memory-only keypair. |
| bool | VerifySignature(const std::string & address, std::string_view signature, const std::vector< uint8_t > & data) Verify a canonical Genius signature. |
| bool | VerifySignature(const std::string & address, const std::vector< uint8_t > & signature, const std::vector< uint8_t > & data) Verify a canonical Genius signature supplied as bytes. |
| GeniusSigner(const PrivateKey & private_key) Take ownership of an existing secret key. |
|
| std::string | GetAddress() const Return the 128-character hexadecimal Genius public address. |
| std::vector< uint8_t > | Sign(const std::vector< uint8_t > & data) const Sign bytes using the canonical Genius signature encoding. |
Public Attributes¶
| Name | |
|---|---|
| constexpr size_t | PRIVATE_KEY_SIZE |
Detailed Description¶
Owns a Genius keypair without imposing account persistence or lifecycle concerns.
GeniusAccount composes this type, while short-lived signing workflows can use it directly without touching secure storage.
The keypair is held as a raw secp256k1 secret key so that this component depends only on libsecp256k1, not on the crypto3-based ProofSystem.
Public Types Documentation¶
using PrivateKey¶
Big-endian secp256k1 secret key, matching libsecp256k1's own encoding.
Public Functions Documentation¶
function Generate¶
Generate a fresh, in-memory-only keypair.
function VerifySignature¶
static bool VerifySignature(
const std::string & address,
std::string_view signature,
const std::vector< uint8_t > & data
)
Verify a canonical Genius signature.
function VerifySignature¶
static bool VerifySignature(
const std::string & address,
const std::vector< uint8_t > & signature,
const std::vector< uint8_t > & data
)
Verify a canonical Genius signature supplied as bytes.
function GeniusSigner¶
Take ownership of an existing secret key.
function GetAddress¶
Return the 128-character hexadecimal Genius public address.
The address is the uncompressed public key (X followed by Y, both big-endian) without the leading 0x04 tag, hex encoded in lower case. Empty when the secret key is not a valid secp256k1 scalar.
function Sign¶
Sign bytes using the canonical Genius signature encoding.
Public Attributes Documentation¶
variable PRIVATE_KEY_SIZE¶
Updated on 2026-08-28 at 01:08:42 +0000