sequoia-cryptoki 0.2.0

Library for working with PKCS#11 devices (cryptokis) from Sequoia
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use cryptoki::types::AuthPin;

use crate::Result;
use crate::Token;

impl Token {
    /// Returns if the PIN is valid.
    ///
    /// This tries to log in to the token.  If the PIN is wrong, this
    /// will decrement the retry counter.
    pub fn check_password<P>(&self, pin: P) -> Result<()>
    where
        P: Into<AuthPin>
    {
        self.open_ro_user_session(pin.into())?;
        Ok(())
    }
}