diff --git a/openpgp-card-sequoia/src/lib.rs b/openpgp-card-sequoia/src/lib.rs index 8c9ab67..8b325e6 100644 --- a/openpgp-card-sequoia/src/lib.rs +++ b/openpgp-card-sequoia/src/lib.rs @@ -442,15 +442,28 @@ impl<'a> Card> { // --- application data --- pub fn application_identifier(&self) -> Result { - self.state.ard.application_id() + // Use immutable data cache from underlying Card + self.state.opt.application_identifier() + } + + pub fn extended_capabilities(&self) -> Result { + // Use immutable data cache from underlying Card + self.state.opt.extended_capabilities() } pub fn historical_bytes(&self) -> Result { - self.state.ard.historical_bytes() + // Use immutable data cache from underlying Card + match self.state.opt.historical_bytes()? { + Some(hb) => Ok(hb), + None => Err(Error::NotFound( + "Card doesn't have historical bytes DO".to_string(), + )), + } } pub fn extended_length_information(&self) -> Result, Error> { - self.state.ard.extended_length_information() + // Use immutable data cache from underlying Card + self.state.opt.extended_length_info() } #[allow(dead_code)] @@ -463,10 +476,7 @@ impl<'a> Card> { unimplemented!() } - pub fn extended_capabilities(&self) -> Result { - self.state.ard.extended_capabilities() - } - + /// Get algorithm attributes for a key slot. pub fn algorithm_attributes(&self, key_type: KeyType) -> Result { self.state.ard.algorithm_attributes(key_type) }