From a9bf175ed635637062bf1418473d6e2694d4eac8 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Fri, 27 Aug 2021 22:30:21 +0200 Subject: [PATCH] Add architecture diagram and some notes on architecture --- README.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cf6ac57..7be4e35 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ specification, in Rust. The project consists of a number of crates: - [openpgp-card](https://crates.io/crates/openpgp-card), which offers an - implementation-agnostic, relatively low level OpenPGP card client API. It - can be used with any PGP implementation. + implementation-agnostic, relatively low level OpenPGP card client API. + It is PGP implementation agnostic. - [openpgp-card-sequoia](https://crates.io/crates/openpgp-card-sequoia), - adds a higher level API and functionality to conveniently use the - openpgp-card library with [Sequoia PGP](https://sequoia-pgp.org/). + a higher level API for conveniently using openpgp-card with + [Sequoia PGP](https://sequoia-pgp.org/). - [openpgp-card-pcsc](https://crates.io/crates/openpgp-card-pcsc), a backend to communicate with smartcards via pcsc. - [openpgp-card-scdc](https://gitlab.com/hkos/openpgp-card/-/tree/main/scdc), @@ -23,6 +23,24 @@ The project consists of a number of crates: - [openpgp-card-tests](https://gitlab.com/hkos/openpgp-card/-/tree/main/card-functionality), a testsuite to run OpenPGP card operations on smartcards. +**Architecture** + +```mermaid +graph BT + OP["openpgp-card-pcsc
(backend)"] --> OC + OS["openpgp-card-scdc
(backend)"] --> OC["openpgp-card
(low level API)"] + OC --> OCS["openpgp-card-sequoia
(high level, sequoia based API)"] + OC -.-> U1[non-sequoia/low level user application] + OCS -.-> U2[sequoia-based user application] + +classDef userApp stroke-dasharray: 5 5; +class U1,U2 userApp; +``` + +The backends implement very simple transport functionality. They can send +APDU commands and receive responses. All OpenPGP card-specific logic, +as well as command chaining are handled in `openpgp-card`. + **Acknowledgements** This project is based on the