Minor edits on doc comments.
This commit is contained in:
parent
0d249a47fd
commit
1b9d860adf
3 changed files with 11 additions and 7 deletions
|
@ -79,17 +79,17 @@ impl<'a> crypto::Decryptor for CardDecryptor<'a> {
|
||||||
&self.public
|
&self.public
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn decrypt(
|
||||||
|
&mut self,
|
||||||
|
ciphertext: &mpi::Ciphertext,
|
||||||
|
_plaintext_len: Option<usize>,
|
||||||
|
) -> openpgp::Result<crypto::SessionKey> {
|
||||||
/// Delegate a decryption operation to the OpenPGP card.
|
/// Delegate a decryption operation to the OpenPGP card.
|
||||||
///
|
///
|
||||||
/// This fn prepares the data structures that openpgp-card needs to
|
/// This fn prepares the data structures that openpgp-card needs to
|
||||||
/// perform the decryption operation.
|
/// perform the decryption operation.
|
||||||
///
|
///
|
||||||
/// (7.2.11 PSO: DECIPHER)
|
/// (7.2.11 PSO: DECIPHER)
|
||||||
fn decrypt(
|
|
||||||
&mut self,
|
|
||||||
ciphertext: &mpi::Ciphertext,
|
|
||||||
_plaintext_len: Option<usize>,
|
|
||||||
) -> openpgp::Result<crypto::SessionKey> {
|
|
||||||
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());
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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)?
|
||||||
|
|
Loading…
Reference in a new issue