openpgp-card/card-functionality/src/list-cards.rs
Heiko Schaefer 0e94871189
Implement PcscCard::transaction() to replace the transaction!() macro.
(This currently requires unreleased pcsc from git)
2022-02-15 15:34:52 +01:00

20 lines
526 B
Rust

// SPDX-FileCopyrightText: 2021 Heiko Schaefer <heiko@schaefer.name>
// SPDX-License-Identifier: MIT OR Apache-2.0
use anyhow::Result;
use openpgp_card_pcsc::PcscCard;
use openpgp_card_sequoia::card::Open;
fn main() -> Result<()> {
println!("The following OpenPGP cards are connected to your system:");
for mut card in PcscCard::cards(None)? {
let mut txc = card.transaction()?;
let open = Open::new(&mut txc)?;
println!(" {}", open.application_identifier()?.ident());
}
Ok(())
}