Minor edits on doc comments.

This commit is contained in:
Heiko Schaefer 2021-09-11 16:51:57 +02:00
parent 0d249a47fd
commit 1b9d860adf
3 changed files with 11 additions and 7 deletions

View file

@ -79,17 +79,17 @@ impl<'a> crypto::Decryptor for CardDecryptor<'a> {
&self.public &self.public
} }
/// Delegate a decryption operation to the OpenPGP card.
///
/// This fn prepares the data structures that openpgp-card needs to
/// perform the decryption operation.
///
/// (7.2.11 PSO: DECIPHER)
fn decrypt( fn decrypt(
&mut self, &mut self,
ciphertext: &mpi::Ciphertext, ciphertext: &mpi::Ciphertext,
_plaintext_len: Option<usize>, _plaintext_len: Option<usize>,
) -> openpgp::Result<crypto::SessionKey> { ) -> openpgp::Result<crypto::SessionKey> {
/// Delegate a decryption operation to the OpenPGP card.
///
/// This fn prepares the data structures that openpgp-card needs to
/// perform the decryption operation.
///
/// (7.2.11 PSO: DECIPHER)
match (ciphertext, self.public.mpis()) { match (ciphertext, self.public.mpis()) {
(mpi::Ciphertext::RSA { c: ct }, mpi::PublicKey::RSA { .. }) => { (mpi::Ciphertext::RSA { c: ct }, mpi::PublicKey::RSA { .. }) => {
let dm = Cryptogram::RSA(ct.value()); let dm = Cryptogram::RSA(ct.value());

View file

@ -1,7 +1,9 @@
// SPDX-FileCopyrightText: 2021 Heiko Schaefer <heiko@schaefer.name> // SPDX-FileCopyrightText: 2021 Heiko Schaefer <heiko@schaefer.name>
// SPDX-License-Identifier: MIT OR Apache-2.0 // SPDX-License-Identifier: MIT OR Apache-2.0
//! Simple wrappers for performing very specific tasks with Sequoia PGP //! Simple wrappers for performing very specific tasks with Sequoia PGP.
//!
//! These helpers are (almost) entirely unrelated to OpenPGP Card.
use anyhow::{anyhow, Context, Result}; use anyhow::{anyhow, Context, Result};
use std::io; use std::io;

View file

@ -38,6 +38,8 @@ use crate::{decryptor, signer, PublicKey};
/// Create a Cert from the three subkeys on a card. /// Create a Cert from the three subkeys on a card.
/// (Calling this multiple times will result in different Certs!) /// (Calling this multiple times will result in different Certs!)
/// ///
/// FIXME: contains hardcoded default passwords!
///
/// FIXME: make dec/auth keys optional /// FIXME: make dec/auth keys optional
/// ///
/// FIXME: accept optional metadata for user_id(s)? /// FIXME: accept optional metadata for user_id(s)?