@dottedice/usb-token-policy-guard
v1.0.6
Published
CCID security policy enforcer and APDU inspector for secure USB token communications
Maintainers
Readme
Legal Terms & Disclaimer
This open-source package is distributed strictly for technical education and architectural research purposes. For full warranty disclaimers, export control notices (US EAR / EU Dual-Use), and limitation of liability terms, please review our Open Source Terms & Disclaimer.
@dottedice/usb-token-policy-guard
Programmatic APDU (Application Protocol Data Unit) firewall and security enforcer for browser-based WebUSB CCID token communications. Protects USB smartcards against PIN verification bypasses and proprietary vendor backdoors.
Installation
npm install @dottedice/usb-token-policy-guardFeatures
- APDU Firewalls: Filters out non-standard ISO/IEC 7816-4 commands to block proprietary debugging routines.
- PIN Length Guards: Intercepts
VERIFY_PINframes to prevent buffer overflow attacks. - Wrapper Utilities: Easily wraps low-level transport functions to enforce policy checks transparently.
API Reference
inspectAPDU(apduBytes)
Inspects the header of the APDU packet and throws an error if it violates safety policies.
apduBytes(Uint8Array): APDU byte array.
wrapSecureTransfer(transferFunc)
Wraps raw transfer functions to run inspectAPDU checks automatically before writing data to hardware.
