feat: init commit

This commit is contained in:
2022-03-27 22:11:36 +08:00
parent d2b101a02b
commit cf044ba7d0
6 changed files with 1792 additions and 0 deletions

18
examples/list_cards.rs Normal file
View File

@@ -0,0 +1,18 @@
use anyhow::Result;
use openpgp_card::OpenPgp;
use openpgp_card_pcsc::PcscBackend;
use openpgp_card_sequoia::card::Open;
fn main() -> Result<()> {
println!("The following OpenPGP cards are connected to your system:");
for mut card in PcscBackend::cards(None)? {
let mut pgp = OpenPgp::new(&mut card);
let open = Open::new(pgp.transaction()?)?;
println!(" {}", open.application_identifier()?.ident());
}
Ok(())
}