openpgp-card-sequoia: use immutable fields from openpgp-card::Card
This commit is contained in:
parent
1681d94710
commit
8f80020f9c
1 changed files with 17 additions and 7 deletions
|
@ -442,15 +442,28 @@ impl<'a> Card<Transaction<'a>> {
|
||||||
// --- application data ---
|
// --- application data ---
|
||||||
|
|
||||||
pub fn application_identifier(&self) -> Result<ApplicationIdentifier, Error> {
|
pub fn application_identifier(&self) -> Result<ApplicationIdentifier, Error> {
|
||||||
self.state.ard.application_id()
|
// Use immutable data cache from underlying Card
|
||||||
|
self.state.opt.application_identifier()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn extended_capabilities(&self) -> Result<ExtendedCapabilities, Error> {
|
||||||
|
// Use immutable data cache from underlying Card
|
||||||
|
self.state.opt.extended_capabilities()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn historical_bytes(&self) -> Result<HistoricalBytes, Error> {
|
pub fn historical_bytes(&self) -> Result<HistoricalBytes, Error> {
|
||||||
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<Option<ExtendedLengthInfo>, Error> {
|
pub fn extended_length_information(&self) -> Result<Option<ExtendedLengthInfo>, Error> {
|
||||||
self.state.ard.extended_length_information()
|
// Use immutable data cache from underlying Card
|
||||||
|
self.state.opt.extended_length_info()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
@ -463,10 +476,7 @@ impl<'a> Card<Transaction<'a>> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn extended_capabilities(&self) -> Result<ExtendedCapabilities, Error> {
|
/// Get algorithm attributes for a key slot.
|
||||||
self.state.ard.extended_capabilities()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn algorithm_attributes(&self, key_type: KeyType) -> Result<AlgorithmAttributes, Error> {
|
pub fn algorithm_attributes(&self, key_type: KeyType) -> Result<AlgorithmAttributes, Error> {
|
||||||
self.state.ard.algorithm_attributes(key_type)
|
self.state.ard.algorithm_attributes(key_type)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue