cryptnox-sdk-arduino 1.0.0
Arduino library for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
VerifyPin.ino File Reference
#include <CryptnoxWallet.h>
#include <SPI.h>
Include dependency graph for VerifyPin.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.
#define DEMO_PIN   "000000000"
 Demo PIN used by this example. Must match the PIN that the card was initialised with (4–9 ASCII digits).

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

◆ DEMO_PIN

#define DEMO_PIN   "000000000"

Demo PIN used by this example. Must match the PIN that the card was initialised with (4–9 ASCII digits).

Definition at line 47 of file VerifyPin.ino.

◆ PN532_SS_PIN

#define PN532_SS_PIN   (10U)

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

Definition at line 41 of file VerifyPin.ino.

Function Documentation

◆ loop()

void loop ( )

Arduino main loop.

One full secure-channel session per iteration on the happy path:

If CryptnoxWallet::verifyPin returns false the sketch enters an infinite halt. This is deliberate: looping would resubmit the same wrong PIN on every iteration and exhaust the card's retry counter within a few seconds, permanently blocking the PIN.

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

Definition at line 97 of file VerifyPin.ino.

References DEMO_PIN, F, 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. Halts on init failure (no reader detected) so the user can inspect the Serial output.

Definition at line 70 of file VerifyPin.ino.

References F, serialAdapter, and wallet.

Variable Documentation

◆ cryptoProvider

ArduinoCryptoProvider cryptoProvider

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

Definition at line 56 of file VerifyPin.ino.

◆ platform

ArduinoPlatform platform

Platform adapter (Arduino blocking delay).

Definition at line 59 of file VerifyPin.ino.

◆ serialAdapter

ArduinoLoggerAdapter serialAdapter

Arduino logger adapter — emits SDK diagnostics on Serial.

Definition at line 50 of file VerifyPin.ino.

◆ wallet

High-level Cryptnox wallet wiring the four adapters together.