openpgp-card: add OpenPgp::into_card()

This commit is contained in:
Heiko Schaefer 2023-08-04 14:20:43 +02:00
parent d0fc4b5725
commit b852393039
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
use std::convert::{TryFrom, TryInto};
@ -37,6 +37,14 @@ impl OpenPgp {
}
}
/// 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.card
}
/// Get an OpenPgpTransaction object. This starts a transaction on the underlying
/// CardBackend.
///