openpgp-card-sequoia: add Card<Open>::into_card()

This commit is contained in:
Heiko Schaefer 2023-08-04 14:27:46 +02:00
parent 06cb246a79
commit 7c42ec4d5e
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2021-2022 Heiko Schaefer <heiko@schaefer.name>
// SPDX-FileCopyrightText: 2021-2023 Heiko Schaefer <heiko@schaefer.name>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! This crate offers ergonomic abstractions to use
@ -207,6 +207,14 @@ impl Card<Open> {
Card::<Transaction>::new(opt)
}
/// Get the internal `CardBackend`.
///
/// This is useful to perform operations on the card with a different crate,
/// e.g. `yubikey-management`.
pub fn into_card(self) -> Box<dyn CardBackend + Send + Sync> {
self.state.pgp.into_card()
}
}
impl<'a> Card<Transaction<'a>> {