Get pcsc card via PcscClient::open_by_ident(), instead of manually filtering it from a list of all cards.
This commit is contained in:
parent
f312ce94f7
commit
9a3b47f0fa
1 changed files with 1 additions and 13 deletions
|
@ -97,19 +97,7 @@ impl TestCard {
|
||||||
let res = ScdClient::shutdown_scd(None);
|
let res = ScdClient::shutdown_scd(None);
|
||||||
log::trace!(" Attempt to shutdown scd: {:?}", res);
|
log::trace!(" Attempt to shutdown scd: {:?}", res);
|
||||||
|
|
||||||
for mut ca in PcscClient::cards()? {
|
Ok(PcscClient::open_by_ident(ident)?)
|
||||||
// Set Card Capabilities (chaining, command length, ..)
|
|
||||||
let ard = ca.application_related_data()?;
|
|
||||||
let app_id = ard.application_id()?;
|
|
||||||
|
|
||||||
if app_id.ident().as_str() == ident.to_uppercase() {
|
|
||||||
// println!("opened pcsc card {}", ident);
|
|
||||||
|
|
||||||
return Ok(ca);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Err(anyhow!("Pcsc card {} not found", ident))
|
|
||||||
}
|
}
|
||||||
Self::Scdc(serial) => {
|
Self::Scdc(serial) => {
|
||||||
// println!("open scdc card {}", serial);
|
// println!("open scdc card {}", serial);
|
||||||
|
|
Loading…
Reference in a new issue