diff --git a/openpgp-card/src/lib.rs b/openpgp-card/src/lib.rs index 3e9931a..022c9fd 100644 --- a/openpgp-card/src/lib.rs +++ b/openpgp-card/src/lib.rs @@ -84,31 +84,25 @@ pub type CardClientBox = Box; #[derive(Clone, Copy, Debug)] pub struct CardCaps { /// Extended Lc and Le fields - pub ext_support: bool, + ext_support: bool, /// Command chaining - pub chaining_support: bool, + chaining_support: bool, /// Maximum number of bytes in a command APDU - pub max_cmd_bytes: u16, + max_cmd_bytes: u16, /// Maximum number of bytes in a response APDU - pub max_rsp_bytes: u16, + max_rsp_bytes: u16, } impl CardCaps { - pub fn new( - ext_support: bool, - chaining_support: bool, - max_cmd_bytes: u16, - max_rsp_bytes: u16, - ) -> CardCaps { - Self { - ext_support, - chaining_support, - max_cmd_bytes, - max_rsp_bytes, - } + pub fn get_ext_support(&self) -> bool { + self.ext_support + } + + pub fn get_max_rsp_bytes(&self) -> u16 { + self.max_rsp_bytes } } diff --git a/scdc/src/lib.rs b/scdc/src/lib.rs index 89bf592..53d26b8 100644 --- a/scdc/src/lib.rs +++ b/scdc/src/lib.rs @@ -197,9 +197,9 @@ impl CardClient for ScdClient { let hex = hex::encode(cmd); let ext = if self.card_caps.is_some() - && self.card_caps.unwrap().ext_support + && self.card_caps.unwrap().get_ext_support() { - format!("--exlen={} ", self.card_caps.unwrap().max_rsp_bytes) + format!("--exlen={} ", self.card_caps.unwrap().get_max_rsp_bytes()) } else { "".to_string() };