cryptnox-sdk-cpp 1.0.0
Platform-independent C++ core SDK for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
CW_SignRequest Struct Reference

Request parameters for CryptnoxWallet::sign. More...

#include <CryptnoxWallet.h>

Collaboration diagram for CW_SignRequest:
[legend]

Public Member Functions

 CW_SignRequest (CW_SecureSession &sess, uint8_t kType=CW_SIGN_CURR_K1, uint8_t sigType=CW_SIGN_SIG_ECDSA_LOW_S, bool pinless=CW_SIGN_WITH_PIN)
 Construct a sign request with sensible defaults.
 ~CW_SignRequest ()
 Securely wipes the PIN buffer.

Public Attributes

CW_SecureSessionsession
uint8_t keyType
uint8_t signatureType
uint8_t pin [CW_MAX_PIN_LENGTH]
bool pinLessMode
const uint8_t * hash
uint8_t hashLength
const uint8_t * derivePath
uint8_t derivePathLength

Detailed Description

Request parameters for CryptnoxWallet::sign.

Owns the PIN buffer for the lifetime of the request — the destructor securely wipes it (CW_Utils::secure_wipe), so allocating the request on the stack inside a tight scope is the recommended pattern.

Definition at line 74 of file CryptnoxWallet.h.

Constructor & Destructor Documentation

◆ CW_SignRequest()

CW_SignRequest::CW_SignRequest ( CW_SecureSession & sess,
uint8_t kType = CW_SIGN_CURR_K1,
uint8_t sigType = CW_SIGN_SIG_ECDSA_LOW_S,
bool pinless = CW_SIGN_WITH_PIN )
inlineexplicit

Construct a sign request with sensible defaults.

Parameters
[in]sessOpen secure session.
[in]kTypeKey type. Defaults to CW_SIGN_CURR_K1.
[in]sigTypeSignature type. Defaults to CW_SIGN_SIG_ECDSA_LOW_S.
[in]pinlessPIN mode. Defaults to PIN required (CW_SIGN_WITH_PIN).

Definition at line 92 of file CryptnoxWallet.h.

References CW_SIGN_CURR_K1, CW_SIGN_SIG_ECDSA_LOW_S, CW_SIGN_WITH_PIN, derivePath, derivePathLength, hash, hashLength, keyType, pin, pinLessMode, session, and signatureType.

◆ ~CW_SignRequest()

CW_SignRequest::~CW_SignRequest ( )
inline

Securely wipes the PIN buffer.

Definition at line 103 of file CryptnoxWallet.h.

References pin, and CW_Utils::secure_wipe().

Member Data Documentation

◆ derivePath

const uint8_t* CW_SignRequest::derivePath

BIP32 path bytes for DERIVE modes; NULL for CURR / PINLESS modes.

Definition at line 82 of file CryptnoxWallet.h.

Referenced by CryptnoxWallet::buildSignPayload(), and CW_SignRequest().

◆ derivePathLength

uint8_t CW_SignRequest::derivePathLength

Length of derivePath in bytes (must be a multiple of 4).

Definition at line 83 of file CryptnoxWallet.h.

Referenced by CryptnoxWallet::buildSignPayload(), and CW_SignRequest().

◆ hash

const uint8_t* CW_SignRequest::hash

Pointer to the hash to sign (typically 32 bytes — SHA-256 of the transaction).

Definition at line 80 of file CryptnoxWallet.h.

Referenced by CryptnoxWallet::buildSignPayload(), CW_SignRequest(), and CryptnoxWallet::validateSignRequest().

◆ hashLength

uint8_t CW_SignRequest::hashLength

Length of hash in bytes (must be ≤ CW_HASH_SIZE).

Definition at line 81 of file CryptnoxWallet.h.

Referenced by CryptnoxWallet::buildSignPayload(), CW_SignRequest(), and CryptnoxWallet::validateSignRequest().

◆ keyType

uint8_t CW_SignRequest::keyType

Key / path type — one of the CW_SIGN_CURR_*, CW_SIGN_DERIVE_*, CW_SIGN_PINLESS_K1 constants.

Definition at line 76 of file CryptnoxWallet.h.

Referenced by CryptnoxWallet::buildSignPayload(), CW_SignRequest(), CryptnoxWallet::sendSignApdu(), and CryptnoxWallet::validateSignRequest().

◆ pin

uint8_t CW_SignRequest::pin[CW_MAX_PIN_LENGTH]

PIN bytes (4–9 ASCII digits). Zero-padded; cleared in the destructor.

Definition at line 78 of file CryptnoxWallet.h.

Referenced by CryptnoxWallet::buildSignPayload(), CW_SignRequest(), CryptnoxWallet::validateSignRequest(), and ~CW_SignRequest().

◆ pinLessMode

bool CW_SignRequest::pinLessMode

false = PIN path, true = PIN-less path (requires keyType == CW_SIGN_PINLESS_K1).

Definition at line 79 of file CryptnoxWallet.h.

Referenced by CryptnoxWallet::buildSignPayload(), CW_SignRequest(), and CryptnoxWallet::validateSignRequest().

◆ session

CW_SecureSession& CW_SignRequest::session

Reference to an open secure session.

Definition at line 75 of file CryptnoxWallet.h.

Referenced by CW_SignRequest(), CryptnoxWallet::sendSignApdu(), and CryptnoxWallet::validateSignRequest().

◆ signatureType

uint8_t CW_SignRequest::signatureType

Signature format — one of CW_SIGN_SIG_ECDSA_LOW_S, CW_SIGN_SIG_ECDSA_EOSIO, CW_SIGN_SIG_SCHNORR_BIP340.

Definition at line 77 of file CryptnoxWallet.h.

Referenced by CW_SignRequest(), and CryptnoxWallet::sendSignApdu().


The documentation for this struct was generated from the following file: