Rename ApplicationRelatedData::get_aid() to get_application_id()
This commit is contained in:
parent
c25c8b55b8
commit
935c77f59a
5 changed files with 12 additions and 8 deletions
|
@ -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)?;
|
||||
|
|
|
@ -601,8 +601,10 @@ impl CardBase {
|
|||
self.card_app.get_app_data()
|
||||
}
|
||||
|
||||
pub fn get_aid(&self) -> Result<ApplicationId, OpenpgpCardError> {
|
||||
self.ard.get_aid()
|
||||
pub fn get_application_id(
|
||||
&self,
|
||||
) -> Result<ApplicationId, OpenpgpCardError> {
|
||||
self.ard.get_application_id()
|
||||
}
|
||||
|
||||
pub fn get_historical(&self) -> Result<Historical, OpenpgpCardError> {
|
||||
|
|
|
@ -48,7 +48,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||
// 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<dyn Error>> {
|
|||
// &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<dyn Error>> {
|
|||
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);
|
||||
|
|
|
@ -36,7 +36,9 @@ pub struct ApplicationRelatedData(pub(crate) Tlv);
|
|||
|
||||
impl ApplicationRelatedData {
|
||||
/// Application identifier (AID), ISO 7816-4
|
||||
pub fn get_aid(&self) -> Result<ApplicationId, OpenpgpCardError> {
|
||||
pub fn get_application_id(
|
||||
&self,
|
||||
) -> Result<ApplicationId, OpenpgpCardError> {
|
||||
// get from cached "application related data"
|
||||
let aid = self.0.find(&[0x4f].into());
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ impl PcscClient {
|
|||
ident: &str,
|
||||
) -> Result<Option<CardClientBox>, 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()))
|
||||
|
|
Loading…
Reference in a new issue