Add notes about using Protected memory for private key material.

This commit is contained in:
Heiko Schaefer 2021-10-05 17:38:08 +02:00
parent ddf62dbfe2
commit a4c04de09c

View file

@ -85,6 +85,9 @@ pub enum PrivateKeyMaterial {
/// RSA-specific container for private key material to upload to an OpenPGP /// RSA-specific container for private key material to upload to an OpenPGP
/// card. /// card.
pub trait RSAKey { pub trait RSAKey {
// FIXME: use a mechanism like sequoia_openpgp::crypto::mem::Protected
// for private key material?
fn get_e(&self) -> &[u8]; fn get_e(&self) -> &[u8];
fn get_p(&self) -> &[u8]; fn get_p(&self) -> &[u8];
fn get_q(&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 /// ECC-specific container for private key material to upload to an OpenPGP
/// card. /// card.
pub trait EccKey { pub trait EccKey {
// FIXME: use a mechanism like sequoia_openpgp::crypto::mem::Protected
// for private key material?
fn get_oid(&self) -> &[u8]; fn get_oid(&self) -> &[u8];
fn get_private(&self) -> Vec<u8>; fn get_private(&self) -> Vec<u8>;
fn get_public(&self) -> Vec<u8>; fn get_public(&self) -> Vec<u8>;