OpenPGP Card (v3.4) APDU command/response layer.
Phase 4 of extending keyroost toward ykman parity. The OpenPGP applet is a
CCID/APDU smartcard applet on YubiKeys and Trussed devices (Solo 2 / Nitrokey
3, via opcard), reachable over the existing PC/SC transport — no second
transport stack. This crate is the pure-Rust command/response layer (APDU
builders + the application-related-data TLV parser); the actual card exchange
lives in keyroost-transport.
Reference: OpenPGP Card spec v3.4, and Nitrokey/opcard-rs.
What is and isn't here
This is the byte layer: it turns intentions into APDU byte vectors and
turns response byte slices into typed structures. It performs no I/O.
Card transmit, the 61xx / GET RESPONSE reassembly loop, PIN entry, and
the higher-level key-management operations are deliberately left for the
transport phase; see the TODO(transport) notes on [Instruction] and the
builders that are intentionally absent.
Unlike the OATH applet (Yubico's SIMPLE-TLV, short-form lengths only), the
OpenPGP applet uses ISO 7816-4 BER-TLV: two-byte ("high") tags and
long-form lengths. The parser here handles both forms; see [parse_tlvs].