feat: init commit
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
target/
|
||||
.idea/
|
||||
1747
Cargo.lock
generated
Normal file
1747
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
Normal file
14
Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "openpgp-card-test"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.56"
|
||||
openpgp-card = "0.2.2"
|
||||
openpgp-card-pcsc = "0.2.1"
|
||||
openpgp-card-sequoia = "0.0.8"
|
||||
openpgp-card-scdc = "0.2.1"
|
||||
|
||||
18
examples/list_cards.rs
Normal file
18
examples/list_cards.rs
Normal 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(())
|
||||
}
|
||||
|
||||
8
justfile
Normal file
8
justfile
Normal file
@@ -0,0 +1,8 @@
|
||||
_:
|
||||
@just --list
|
||||
|
||||
# example list cards
|
||||
example_list_cards:
|
||||
cargo run --example list_cards
|
||||
|
||||
|
||||
3
src/main.rs
Normal file
3
src/main.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Reference in New Issue
Block a user