Adjust openpgp-card-examples to changed openpgp-card API

This commit is contained in:
Heiko Schaefer 2022-01-20 03:13:48 +01:00
parent 36b9fb2770
commit e92cad5b6a
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D
3 changed files with 11 additions and 6 deletions

View file

@ -16,6 +16,7 @@ sequoia-openpgp = "1.3"
nettle = "7" nettle = "7"
openpgp-card = { path = "../openpgp-card", version = "0.1" } openpgp-card = { path = "../openpgp-card", version = "0.1" }
openpgp-card-pcsc = { path = "../pcsc", version = "0.1" } openpgp-card-pcsc = { path = "../pcsc", version = "0.1" }
pcsc="2"
openpgp-card-sequoia = { path = "../openpgp-card-sequoia", version = "0.0.7" } openpgp-card-sequoia = { path = "../openpgp-card-sequoia", version = "0.0.7" }
chrono = "0.4" chrono = "0.4"
anyhow = "1" anyhow = "1"

View file

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2021 Wiktor Kwapisiewicz <wiktor@metacode.biz> // SPDX-FileCopyrightText: 2021 Wiktor Kwapisiewicz <wiktor@metacode.biz>
// SPDX-License-Identifier: MIT OR Apache-2.0 // SPDX-License-Identifier: MIT OR Apache-2.0
use openpgp_card_pcsc::PcscCard; use openpgp_card_pcsc::{get_txc, PcscCard, TxClient};
use openpgp_card_sequoia::card::Open; use openpgp_card_sequoia::card::Open;
@ -22,8 +22,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let pin_file = &args[1]; let pin_file = &args[1];
let cert_file = &args[2]; let cert_file = &args[2];
let mut ca = PcscCard::open_by_ident(card_ident)?; let mut card = PcscCard::open_by_ident(card_ident)?;
let mut open = Open::new(&mut ca)?; let mut txc = get_txc!(card)?;
let mut open = Open::new(&mut txc)?;
let pin = std::fs::read_to_string(pin_file)?; let pin = std::fs::read_to_string(pin_file)?;

View file

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2021 Wiktor Kwapisiewicz <wiktor@metacode.biz> // SPDX-FileCopyrightText: 2021 Wiktor Kwapisiewicz <wiktor@metacode.biz>
// SPDX-License-Identifier: MIT OR Apache-2.0 // SPDX-License-Identifier: MIT OR Apache-2.0
use openpgp_card_pcsc::PcscCard; use openpgp_card_pcsc::{get_txc, PcscCard, TxClient};
use openpgp_card_sequoia::card::Open; use openpgp_card_sequoia::card::Open;
@ -22,8 +22,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let pin_file = &args[1]; let pin_file = &args[1];
let cert_file = &args[2]; let cert_file = &args[2];
let mut ca = PcscCard::open_by_ident(card_ident)?; let mut card = PcscCard::open_by_ident(card_ident)?;
let mut open = Open::new(&mut ca)?; let mut txc = get_txc!(card)?;
let mut open = Open::new(&mut txc)?;
let pin = std::fs::read_to_string(pin_file)?; let pin = std::fs::read_to_string(pin_file)?;