#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

#321 in Cryptography

Download history 57/week @ 2024-07-22 233/week @ 2024-07-29 52/week @ 2024-08-05 97/week @ 2024-08-12 92/week @ 2024-08-19 361/week @ 2024-08-26 93/week @ 2024-09-02 95/week @ 2024-09-09 291/week @ 2024-09-16 209/week @ 2024-09-23 126/week @ 2024-09-30 30/week @ 2024-10-07 236/week @ 2024-10-14 193/week @ 2024-10-21 38/week @ 2024-10-28 122/week @ 2024-11-04

590 downloads per month
Used in 20 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.5–3.5MB
~66K SLoC