keycard-nim

November 10, 2025 ยท View on GitHub

A Nim SDK to interact with the Status Keycard - a hardware wallet implementation on JavaCard.

Documentation

Installation

git clone https://github.com/mmlado/keycard-nim.git
cd keycard-nim
nimble install

Dependencies

  • pcsc-nim - PC/SC library for smart card access
  • Nim >= 1.6.14

Quick Start

import keycard/keycard
import keycard/commands/select
import keycard/transport

# Create keycard instance
let t = newTransport()
var card = newKeycard(t)

# Connect to first reader
let readers = card.listReaders()
card.connect(readers[0])
defer: card.close()

# Select the Keycard applet
let result = card.select()
if result.success:
  echo "Card version: ", card.version()
  echo "Initialized: ", card.isInitialized()
  echo "Secure channel: ", card.hasSecureChannel()

Testing

Run tests with mock PC/SC (no hardware required):

nimble test

Run example with real card:

nimble example

Clean build artifacts:

nimble clean

Contributing

Contributions welcome! Please:

  1. Run tests before submitting (nimble test)
  2. Follow existing code style
  3. Add tests for new features
  4. Update this README with implementation status

License

MIT

References