cryptnox-sdk-arduino 1.0.0
Arduino library for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
Connect.ino File Reference
#include <CryptnoxWallet.h>
#include <SPI.h>
Include dependency graph for Connect.ino:

Go to the source code of this file.

Macros

#define PN532_SS_PIN   (10U)
 SPI slave-select (CS) pin connected to the PN532 module.

Functions

PN532Adapter nfc (serialAdapter, PN532_SS_PIN, &SPI)
 PN532 transport adapter over SPI.
void setup ()
 Arduino setup hook.
void loop ()
 Arduino main loop.

Variables

ArduinoLoggerAdapter serialAdapter
 Arduino logger adapter — emits SDK diagnostics on Serial.
ArduinoCryptoProvider cryptoProvider
 Crypto provider (AES / SHA / micro-ecc / TRNG bridge for Arduino).
ArduinoPlatform platform
 Platform adapter (Arduino blocking delay).
CryptnoxWallet wallet (nfc, serialAdapter, cryptoProvider, platform)
 High-level Cryptnox wallet wiring the four adapters together.

Macro Definition Documentation

◆ PN532_SS_PIN

#define PN532_SS_PIN   (10U)

SPI slave-select (CS) pin connected to the PN532 module.

Examples
Connect.ino, Sign.ino, UsdcSigning.ino, and VerifyPin.ino.

Definition at line 31 of file Connect.ino.

Referenced by nfc().

Function Documentation

◆ loop()

void loop ( )

Arduino main loop.

One full secure-channel session per iteration:

  • CryptnoxWallet::connect performs SELECT + manufacturer cert verification + ECDH key agreement + mutual authentication. When it returns true the channel is mathematically established (session.aesKey, session.macKey, session.iv are populated and authenticated against the card).
  • CryptnoxWallet::getCardInfo fetches card identity over the channel; on enabled debug logging it prints the card info bytes.
  • CryptnoxWallet::disconnect tears the channel down and zeroes the session keys.

The 1 s delay between iterations gives time to remove/replace the card and keeps the Serial output readable.

Definition at line 88 of file Connect.ino.

References CW_CardInfo::email, F, CW_CardInfo::name, serialAdapter, and wallet.

◆ nfc()

PN532 transport adapter over SPI.

References PN532_SS_PIN, and serialAdapter.

◆ setup()

void setup ( )

Arduino setup hook.

Brings up Serial, the SPI bus and the PN532 reader, then prints the PN532 firmware version as a sanity check that the reader is alive and speaking. Halts on init failure so the user can inspect the Serial output.

Definition at line 56 of file Connect.ino.

References F, nfc(), serialAdapter, and wallet.

Variable Documentation

◆ cryptoProvider

ArduinoCryptoProvider cryptoProvider

Crypto provider (AES / SHA / micro-ecc / TRNG bridge for Arduino).

Definition at line 40 of file Connect.ino.

◆ platform

ArduinoPlatform platform

Platform adapter (Arduino blocking delay).

Definition at line 43 of file Connect.ino.

◆ serialAdapter

ArduinoLoggerAdapter serialAdapter

Arduino logger adapter — emits SDK diagnostics on Serial.

Definition at line 34 of file Connect.ino.

◆ wallet

High-level Cryptnox wallet wiring the four adapters together.