TLS SE APP Main Commands - purien/IoSE GitHub Wiki

Command structure

All commands comprise a header:

  • one character
  • two hexadecimal digits (0123456789ABCDEF)
  • All commands are ended by CrLf characters (only Lf is also supported)

Response structure

  • a set of characters, ending by CrLf
  • ERROR notifies an error

Clear Key

  • syntax: cxy
  • action: clear public/private keys at index xy (00, 01, 02, 03)
  • response: OK or ERROR

Create Key

  • syntax: gxy
  • action: generate public/private keys at index xy (00, 01, 02, 03)
  • response OK or ERROR

Get public key

  • syntax: pxy
  • action: get public key at index xy
  • response: 130 hexadecimal digits (65 bytes) or ERROR

Get private key

  • syntax: rxy
  • action: get private key at index xy
  • response: 64 hexadecimal digits (32 bytes), or ERROR

Sign data

  • syntax: sxy[data]
  • action: sign data, ECDSA=(R,S) two integer values (2x 32 bytes)
  • response: 64 hexadecimal digits (64 bytes), or ERROR

Set private key

  • syntax Xxy[data]
  • action: set private key at index xy, data up to 64 hexadecimal digits (32 bytes). Depending on smartcard compute public key.
  • response: OK or ERROR

Set public key

  • syntax: Pxy[data]
  • action: set public key at index xy, data 130 hexadecimal digits (65 bytes).
  • response: OK or ERROR

Set BIP32 tree seed

  • syntax: Txy[data]
  • action: set BIP32 seed at index xy, up to 64 hexadecimal digits (32 bytes)
  • response: OK or Error

BIP32 tree seed

  • syntax: vxy
  • action: get BIP32 seed at index xy
  • response: 64 hexadecimal digits (32 bytes), or ERROR

Compute BIP32 key

  • syntax bxy[data]
  • action: compute BIP32 public/private key at index xy. data is a list of integers (nx 32bits) with most significant bit set (example: 8000000180000002)
  • response: OK or ERROR

Write text

  • syntax: Zxy[text]
  • action: write up to 64 charcaters in the record xy (00...1F). Up to 32 records of 64 bytes
  • response: OK or ERROR

Read text

  • syntax: Ixy
  • action: read record xy (00...1F). Up to 32 records of 64 bytes
  • response: up to 64 characters (empty line if no content) or ERROR

Get software version

  • syntax ?00
  • action: Get software version
  • response: software version

Echo

  • syntax: ?01[text]
  • action: echo text
  • response: text content or ERROR

Quit

  • syntax: ?02
  • action: request to close session
  • response: no response

Get ID

  • syntax: ?0A
  • action: get smartcard ID, i.e. public key
  • response: 130 hexadecimal digits (65 bytes) or ERROR

Get Cert

  • syntax: ?0B
  • action: get smartcard certificate = ECDSA(sha256(ID)= (R,S)
  • response: 128 hexadecimal digits (64 bytes)

Authenticate

  • syntax: ?0C[data]
  • action: authentication with smarcard private key, data=r(random), up to 64 hexadecimal digits (32 bytes)
  • response: signature (ASN.1 encoded)= ECDSA= (R,S)= sign(sha256(HS || r)), HS= Handshake Secret or ERROR

Set Cert

  • syntax: ?0E[data]
  • action: set the smartcard certificate, data= (R,S)= sign(sha256(ID)), 256 hexadecimal digits (2x 32 bytes)
  • response OK or ERROR

Set PSK

  • syntax: ?AA[data]
  • action: set the PSK value, data= old_psk || new_psk, 2x 128 hexadecimal digits (2x 32 bytes)
  • response: OK or ERROR

Echo2

  • syntax: ?FF[text]
  • action: echo haxdecimal encoded value
  • response: text value or ERROR
⚠️ **GitHub.com Fallback** ⚠️