diff --git a/openpgp-card/src/card_app.rs b/openpgp-card/src/card_app.rs index 0fdb02b..4093773 100644 --- a/openpgp-card/src/card_app.rs +++ b/openpgp-card/src/card_app.rs @@ -18,7 +18,7 @@ use crate::errors::OpenpgpCardError; use crate::tlv::{tag::Tag, Tlv, TlvEntry}; use crate::{apdu, keys, CardCaps, CardClientBox, KeyType}; -/// Direct, low-level, access to OpenPGP card functionality. +/// Low-level access to OpenPGP card functionality. /// /// No checks are performed here (e.g. for valid data lengths). /// Such checks should be performed on a higher layer, if needed. diff --git a/openpgp-card/src/card_data/mod.rs b/openpgp-card/src/card_data/mod.rs index e133aa0..5426d92 100644 --- a/openpgp-card/src/card_data/mod.rs +++ b/openpgp-card/src/card_data/mod.rs @@ -352,6 +352,7 @@ impl KeySet { } } +/// nom parsing helper pub(crate) fn complete(result: nom::IResult<&[u8], O>) -> Result { let (rem, output) = result.map_err(|err| anyhow!("Parsing failed: {:?}", err))?; diff --git a/openpgp-card/src/errors.rs b/openpgp-card/src/errors.rs index 5ed6141..652fcdd 100644 --- a/openpgp-card/src/errors.rs +++ b/openpgp-card/src/errors.rs @@ -1,13 +1,13 @@ // SPDX-FileCopyrightText: 2021 Heiko Schaefer // SPDX-License-Identifier: MIT OR Apache-2.0 -//! Error types that are used by this crate. +//! Error types used by this crate. //! //! [`OpenpgpCardError`] is a wrapper enum for all error types that are used. //! -//! The two main cases are: +//! The two main classes of errors are: //! - [`SmartcardError`], for problems on the reader/smartcard layer -//! - [`OcErrorStatus`] which models error statuses reported by the OpenPGP +//! - [`OcErrorStatus`], which models error statuses reported by the OpenPGP //! card application use thiserror::Error; diff --git a/openpgp-card/src/lib.rs b/openpgp-card/src/lib.rs index 7a2a804..572dcd2 100644 --- a/openpgp-card/src/lib.rs +++ b/openpgp-card/src/lib.rs @@ -41,7 +41,7 @@ pub use crate::card_app::CardApp; /// The CardClient trait defines communication with an OpenPGP card via a /// backend implementation (e.g. the pcsc backend in the crate -/// openpgp-card-pcsc). +/// [openpgp-card-pcsc](https://crates.io/crates/openpgp-card-pcsc)). pub trait CardClient { /// Transmit the command data in `cmd` to the card. /// @@ -71,9 +71,13 @@ pub trait CardClient { } } +/// A boxed CardClient (which is Send+Sync). pub type CardClientBox = Box; -/// Information about the capabilities of the card. +/// Configuration of the capabilities of the card. +/// +/// This configuration is used to determine e.g. if chaining or extended +/// length can be used when communicating with the card. /// /// (This configuration is retrieved from card metadata, specifically from /// "Card Capabilities" and "Extended length information")