#openpgp #card #specification #access #low-level #back-end

openpgp-card

A client implementation for the OpenPGP card specification

30 releases

0.5.0 May 28, 2024
0.5.0-alpha.1 Apr 7, 2024
0.4.2 Feb 16, 2024
0.4.0 Sep 5, 2023
0.0.1 Jun 30, 2021

#382 in Cryptography

Download history 58/week @ 2024-08-18 373/week @ 2024-08-25 125/week @ 2024-09-01 96/week @ 2024-09-08 275/week @ 2024-09-15 207/week @ 2024-09-22 142/week @ 2024-09-29 34/week @ 2024-10-06 227/week @ 2024-10-13 188/week @ 2024-10-20 51/week @ 2024-10-27 118/week @ 2024-11-03 80/week @ 2024-11-10 208/week @ 2024-11-17 207/week @ 2024-11-24 73/week @ 2024-12-01

576 downloads per month
Used in 19 crates (13 directly)

MIT/Apache

300KB
6K SLoC

OpenPGP card client library

This crate implements a client library for the OpenPGP card specification, in Rust.

This library provides OpenPGP library agnostic access to OpenPGP cards. Its communication with cards is based on simple data structures that closely match the formats defined in the OpenPGP card specification.

Card access backends

This crate doesn't contain code to talk to cards. Implementations of the traits CardBackend/CardTransaction need to be provided for access to cards.

The crates card-backend-pcsc and the experimental crate card-backend-scdc provide implementations of these traits for use with this crate.


lib.rs:

Client library for OpenPGP card devices (such as Gnuk, Nitrokey, YubiKey, or Java smartcards running an OpenPGP card application).

This library aims to offer

The library exposes two modes of access to cards:

  • low-level, unmediated, access to card functionality (see crate::ocard), and
  • a more opinionated, typed wrapper API that performs some amount of caching [Card].

Note that this library can't directly access cards by itself. Instead, users need to supply a backend that implements the card_backend::CardBackend and card_backend::CardTransaction traits. For example card-backend-pcsc offers a backend implementation that uses PC/SC to communicate with Smart Cards.

See the architecture diagram for an overview of the ecosystem around this crate.

Dependencies

~2.4–3.5MB
~65K SLoC