Struct cryptoki::Pkcs11 [−][src]
Main PKCS11 context. Should usually be unique per application.
Implementations
impl Pkcs11
[src]
pub fn initialize(&self, init_args: CInitializeArgs) -> Result<()>
[src]
Initialize the PKCS11 library
pub fn finalize(self)
[src]
Finalize the PKCS11 library. Indicates that the application no longer needs to use PKCS11. The library is also automatically finalized on drop.
impl Pkcs11
[src]
pub fn open_session_no_callback(
&self,
slot_id: Slot,
flags: Flags
) -> Result<Session<'_>>
[src]
&self,
slot_id: Slot,
flags: Flags
) -> Result<Session<'_>>
Open a new session with no callback set
impl Pkcs11
[src]
pub fn get_slots_with_token(&self) -> Result<Vec<Slot>>
[src]
Get all slots available with a token
pub fn get_all_slots(&self) -> Result<Vec<Slot>>
[src]
Get all slots
pub fn init_token(&self, slot: Slot, pin: &str) -> Result<()>
[src]
Initialize a token
Currently will use an empty label for all tokens.
impl Pkcs11
[src]
pub fn new<P>(filename: P) -> Result<Self> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Instantiate a new context from the path of a PKCS11 dynamic llibrary implementation.
pub fn set_pin(&self, slot: Slot, pin: &str) -> Result<()>
[src]
Set the PIN used when logging in sessions. The pin set is the one that is going to be use with all user type specified when logging in. It needs to be changed before calling login with a different user type.
pub fn clear_pin(&self, slot: Slot)
[src]
Clear the pin store. Ignore if the pin was not set previously on the slot. Note that the pin will be cleared anyway on drop.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Pkcs11
impl Send for Pkcs11
impl Sync for Pkcs11
impl Unpin for Pkcs11
impl !UnwindSafe for Pkcs11
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,