#openpgp #card #access #client #specification #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

#674 in Cryptography

Download history 365/week @ 2024-02-14 105/week @ 2024-02-21 113/week @ 2024-02-28 121/week @ 2024-03-06 179/week @ 2024-03-13 176/week @ 2024-03-20 179/week @ 2024-03-27 250/week @ 2024-04-03 298/week @ 2024-04-10 257/week @ 2024-04-17 277/week @ 2024-04-24 255/week @ 2024-05-01 226/week @ 2024-05-08 231/week @ 2024-05-15 587/week @ 2024-05-22 360/week @ 2024-05-29

1,467 downloads per month
Used in 18 crates (12 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.6–3.5MB
~69K SLoC