openpgp-card-example: adjust to card-backend refactor
This commit is contained in:
parent
7de74d702e
commit
8d5b1c0563
5 changed files with 9 additions and 9 deletions
|
@ -8,6 +8,6 @@ members = [
|
|||
"card-backend",
|
||||
"pcsc",
|
||||
"scdc",
|
||||
# "openpgp-card-examples",
|
||||
"openpgp-card-examples",
|
||||
# "card-functionality",
|
||||
]
|
||||
|
|
|
@ -14,7 +14,7 @@ documentation = "https://docs.rs/crate/openpgp-card-examples"
|
|||
[dependencies]
|
||||
sequoia-openpgp = "1.3"
|
||||
nettle = "7"
|
||||
openpgp-card-pcsc = { path = "../pcsc" }
|
||||
card-backend-pcsc = { path = "../pcsc" }
|
||||
openpgp-card-sequoia = { path = "../openpgp-card-sequoia" }
|
||||
chrono = "0.4"
|
||||
anyhow = "1"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2021 Wiktor Kwapisiewicz <wiktor@metacode.biz>
|
||||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
|
||||
use openpgp_card_pcsc::PcscBackend;
|
||||
use card_backend_pcsc::PcscBackend;
|
||||
use openpgp_card_sequoia::{state::Open, Card};
|
||||
use sequoia_openpgp::parse::{stream::DecryptorBuilder, Parse};
|
||||
use sequoia_openpgp::policy::StandardPolicy;
|
||||
|
@ -17,9 +17,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let card_ident = &args[0];
|
||||
let pin_file = &args[1];
|
||||
|
||||
let backend = PcscBackend::open_by_ident(card_ident, None)?;
|
||||
let cards = PcscBackend::card_backends(None)?;
|
||||
|
||||
let mut card: Card<Open> = backend.into();
|
||||
let mut card: Card<Open> = Card::<Open>::open_by_ident(cards, card_ident)?;
|
||||
let mut transaction = card.transaction()?;
|
||||
|
||||
let pin = std::fs::read(pin_file)?;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2021 Wiktor Kwapisiewicz <wiktor@metacode.biz>
|
||||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
|
||||
use openpgp_card_pcsc::PcscBackend;
|
||||
use card_backend_pcsc::PcscBackend;
|
||||
use openpgp_card_sequoia::{state::Open, Card};
|
||||
use sequoia_openpgp::serialize::stream::{Armorer, Message, Signer};
|
||||
|
||||
|
@ -16,9 +16,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
let card_ident = &args[0];
|
||||
let pin_file = &args[1];
|
||||
|
||||
let backend = PcscBackend::open_by_ident(card_ident, None)?;
|
||||
let cards = PcscBackend::card_backends(None)?;
|
||||
|
||||
let mut card: Card<Open> = backend.into();
|
||||
let mut card: Card<Open> = Card::<Open>::open_by_ident(cards, card_ident)?;
|
||||
let mut transaction = card.transaction()?;
|
||||
|
||||
let pin = std::fs::read(pin_file)?;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
name = "openpgp-card-sequoia"
|
||||
description = "Wrapper of openpgp-card for use with Sequoia PGP"
|
||||
license = "MIT OR Apache-2.0"
|
||||
version = "0.2.0-pre"
|
||||
version = "0.2.0"
|
||||
authors = ["Heiko Schaefer <heiko@schaefer.name>"]
|
||||
edition = "2018"
|
||||
repository = "https://gitlab.com/openpgp-card/openpgp-card"
|
||||
|
|
Loading…
Reference in a new issue