@owf/mdoc
Implementation of ISO/IEC 18013-5 mDOC and mDL (mobile driving licence) documents for Node.js, browsers and React Native. Issue, hold, present and verify CBOR encoded documents, including the presentation flows of ISO/IEC 18013-7 and OpenID4VP.
This package was previously developed in the mdoc-ts repository. It is versioned separately from the other @owf/* packages.
Installation
# Using npm
npm install @owf/mdoc
# Using pnpm
pnpm add @owf/mdoc
# Using yarn
yarn add @owf/mdoc
Usage
The Issuer, Holder and Verifier classes cover issuing, presenting and verifying mDOCs. Cryptographic operations, X.509 certificate handling and fetch are provided through an MdocContext. See the tests for complete flows, and an example MdocContext in context.ts.
Dependencies
Platform Support
This library is platform agnostic and works in:
- Node.js (>=22)
- Browsers (modern browsers with ES2020 support)
- React Native
A global TextEncoder and TextDecoder must be available. See the React Native notes if you need a polyfill.
Contributing
See the Contributing Guide for details on how to contribute to this project.
License
This project is licensed under the Apache License Version 2.0 (Apache-2.0).
Credits
Thanks to:
- auth0/mdl for the mdl implementation on which this package is based.
- auer-martin for removing Node.js dependencies and providing a pluggable crypto interface.