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

openpgp-card

A client implementation for the OpenPGP card specification

26 releases

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

#799 in Cryptography

Download history 44/week @ 2024-01-08 9/week @ 2024-01-15 21/week @ 2024-01-22 9/week @ 2024-01-29 260/week @ 2024-02-12 182/week @ 2024-02-19 119/week @ 2024-02-26 106/week @ 2024-03-04 145/week @ 2024-03-11 202/week @ 2024-03-18 152/week @ 2024-03-25 222/week @ 2024-04-01 306/week @ 2024-04-08 208/week @ 2024-04-15

909 downloads per month
Used in 17 crates (10 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