From a4c04de09c779ce3046c9670084d02649a5c5fef Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Tue, 5 Oct 2021 17:38:08 +0200 Subject: [PATCH] Add notes about using Protected memory for private key material. --- openpgp-card/src/crypto_data.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openpgp-card/src/crypto_data.rs b/openpgp-card/src/crypto_data.rs index 31644d9..98ac9bd 100644 --- a/openpgp-card/src/crypto_data.rs +++ b/openpgp-card/src/crypto_data.rs @@ -85,6 +85,9 @@ pub enum PrivateKeyMaterial { /// RSA-specific container for private key material to upload to an OpenPGP /// card. pub trait RSAKey { + // FIXME: use a mechanism like sequoia_openpgp::crypto::mem::Protected + // for private key material? + fn get_e(&self) -> &[u8]; fn get_p(&self) -> &[u8]; fn get_q(&self) -> &[u8]; @@ -99,6 +102,9 @@ pub trait RSAKey { /// ECC-specific container for private key material to upload to an OpenPGP /// card. pub trait EccKey { + // FIXME: use a mechanism like sequoia_openpgp::crypto::mem::Protected + // for private key material? + fn get_oid(&self) -> &[u8]; fn get_private(&self) -> Vec; fn get_public(&self) -> Vec;