From 935c77f59a0feebe3316f57b077b6c31f98d1db9 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Sat, 28 Aug 2021 19:58:34 +0200 Subject: [PATCH] Rename ApplicationRelatedData::get_aid() to get_application_id() --- card-functionality/src/cards.rs | 2 +- openpgp-card-sequoia/src/lib.rs | 6 ++++-- openpgp-card-sequoia/src/main.rs | 6 +++--- openpgp-card/src/card_do/mod.rs | 4 +++- pcsc/src/lib.rs | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/card-functionality/src/cards.rs b/card-functionality/src/cards.rs index 78d7271..6b96c1d 100644 --- a/card-functionality/src/cards.rs +++ b/card-functionality/src/cards.rs @@ -102,7 +102,7 @@ impl TestCard { // Set Card Capabilities (chaining, command length, ..) let ard = ca.get_app_data()?; - let app_id = ard.get_aid()?; + let app_id = ard.get_application_id()?; if app_id.ident().as_str() == ident { ca.init_caps(&ard)?; diff --git a/openpgp-card-sequoia/src/lib.rs b/openpgp-card-sequoia/src/lib.rs index fd612f2..12af8dd 100644 --- a/openpgp-card-sequoia/src/lib.rs +++ b/openpgp-card-sequoia/src/lib.rs @@ -601,8 +601,10 @@ impl CardBase { self.card_app.get_app_data() } - pub fn get_aid(&self) -> Result { - self.ard.get_aid() + pub fn get_application_id( + &self, + ) -> Result { + self.ard.get_application_id() } pub fn get_historical(&self) -> Result { diff --git a/openpgp-card-sequoia/src/main.rs b/openpgp-card-sequoia/src/main.rs index d3bdcb2..5885fb2 100644 --- a/openpgp-card-sequoia/src/main.rs +++ b/openpgp-card-sequoia/src/main.rs @@ -48,7 +48,7 @@ fn main() -> Result<(), Box> { // card metadata println!("** get aid"); - let app_id = oc.get_aid()?; + let app_id = oc.get_application_id()?; println!("app id: {:x?}\n\n", app_id); println!(" ident: {:?}\n\n", app_id.ident()); @@ -160,7 +160,7 @@ fn main() -> Result<(), Box> { // &test_card_serial, // )?)?; - let app_id = oc.get_aid()?; + let app_id = oc.get_application_id()?; // Check that we're still using the expected card assert_eq!(app_id.ident(), test_card_ident); @@ -243,7 +243,7 @@ fn main() -> Result<(), Box> { let mut ca = CardApp::new(c); let ard = ca.get_app_data()?; - let app_id = ard.get_aid()?; + let app_id = ard.get_application_id()?; let ident = app_id.ident(); println!(" '{}'", ident); diff --git a/openpgp-card/src/card_do/mod.rs b/openpgp-card/src/card_do/mod.rs index 1ab47fe..79c71e6 100644 --- a/openpgp-card/src/card_do/mod.rs +++ b/openpgp-card/src/card_do/mod.rs @@ -36,7 +36,9 @@ pub struct ApplicationRelatedData(pub(crate) Tlv); impl ApplicationRelatedData { /// Application identifier (AID), ISO 7816-4 - pub fn get_aid(&self) -> Result { + pub fn get_application_id( + &self, + ) -> Result { // get from cached "application related data" let aid = self.0.find(&[0x4f].into()); diff --git a/pcsc/src/lib.rs b/pcsc/src/lib.rs index 6269b43..e68083f 100644 --- a/pcsc/src/lib.rs +++ b/pcsc/src/lib.rs @@ -130,7 +130,7 @@ impl PcscClient { ident: &str, ) -> Result, OpenpgpCardError> { let ard = ca.get_app_data()?; - let aid = ard.get_aid()?; + let aid = ard.get_application_id()?; if aid.ident() == ident { Ok(Some(ca.take_card()))