pub struct ScdBackend { /* private fields */ }
Expand description
An implementation of the CardBackend trait that uses GnuPG’s scdaemon (via GnuPG Agent) to access smart cards.
Implementations§
Source§impl ScdBackend
impl ScdBackend
Sourcepub fn open_by_serial(
agent: Option<Agent>,
serial: &str,
) -> Result<Self, SmartcardError>
pub fn open_by_serial( agent: Option<Agent>, serial: &str, ) -> Result<Self, SmartcardError>
Request card with AID serial
from scdaemon, and return it as a ScdBackend.
The client may provide a GnuPG agent
to use.
Sourcepub fn open_yolo(agent: Option<Agent>) -> Result<Self, SmartcardError>
pub fn open_yolo(agent: Option<Agent>) -> Result<Self, SmartcardError>
Open a CardApp that uses an scdaemon instance as its backend.
If multiple cards are available, scdaemon implicitly selects one.
(NOTE: implicitly picking an unspecified card might be a bad idea. You might want to avoid using this function, or check which card you received.)
Sourcepub fn shutdown_scd(agent: Option<Agent>) -> Result<(), SmartcardError>
pub fn shutdown_scd(agent: Option<Agent>) -> Result<(), SmartcardError>
Helper fn that shuts down scdaemon via GnuPG Agent. This may be useful to obtain access to a Smard card via PCSC.
Trait Implementations§
Source§impl CardBackend for ScdBackend
impl CardBackend for ScdBackend
Source§fn limit_card_caps(&self, card_caps: CardCaps) -> CardCaps
fn limit_card_caps(&self, card_caps: CardCaps) -> CardCaps
If a CardBackend introduces a additional (possibly backend-specific)
limits for any fields in CardCaps, this fn can indicate that limit by
returning an amended
CardCaps
.fn transaction( &mut self, _reselect_application: Option<&[u8]>, ) -> Result<Box<dyn CardTransaction + Send + Sync + '_>, SmartcardError>
Source§impl From<ScdBackend> for Box<dyn CardBackend + Sync + Send>
Boxing helper (for easier consumption of PcscBackend in openpgp_card and openpgp_card_sequoia)
impl From<ScdBackend> for Box<dyn CardBackend + Sync + Send>
Boxing helper (for easier consumption of PcscBackend in openpgp_card and openpgp_card_sequoia)
Source§fn from(backend: ScdBackend) -> Box<dyn CardBackend + Sync + Send>
fn from(backend: ScdBackend) -> Box<dyn CardBackend + Sync + Send>
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ScdBackend
impl !RefUnwindSafe for ScdBackend
impl Send for ScdBackend
impl Sync for ScdBackend
impl Unpin for ScdBackend
impl !UnwindSafe for ScdBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more