Botan 3.6.1
Crypto and TLS for C&
|
Represents a PKCS#11 session. More...
#include <p11_types.h>
Public Member Functions | |
SessionInfo | get_info () const |
SessionHandle | handle () const |
void | init_pin (const secure_string &new_pin) |
Calls C_InitPIN to change or initialize the PIN using the SO_PIN (requires a logged in session) | |
void | login (UserType userType, const secure_string &pin) |
void | logoff () |
Logout from this session. | |
Module & | module () const |
Session & | operator= (const Session &other)=delete |
Session & | operator= (Session &&other)=delete |
SessionHandle | release () |
Session (const Session &other)=delete | |
Session (Session &&other)=default | |
Session (Slot &slot, bool read_only) | |
Session (Slot &slot, Flags flags, VoidPtr callback_data, Notify notify_callback) | |
Session (Slot &slot, SessionHandle handle) | |
Takes ownership of a session. | |
void | set_pin (const secure_string &old_pin, const secure_string &new_pin) |
Calls C_SetPIN to change the PIN using the old PIN (requires a logged in session) | |
const Slot & | slot () const |
~Session () noexcept | |
Logout user and close the session on destruction. | |
Represents a PKCS#11 session.
Definition at line 121 of file p11_types.h.
Botan::PKCS11::Session::Session | ( | Slot & | slot, |
bool | read_only ) |
slot | the slot to use |
read_only | true if the session should be read only, false to create a read-write session |
Definition at line 13 of file p11_session.cpp.
Botan::PKCS11::Session::Session | ( | Slot & | slot, |
Flags | flags, | ||
VoidPtr | callback_data, | ||
Notify | notify_callback ) |
slot | the slot to use |
flags | the flags to use for the session. Remark: Flag::SerialSession is mandatory |
callback_data | application-defined pointer to be passed to the notification callback |
notify_callback | address of the notification callback function |
Definition at line 17 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_OpenSession(), Botan::PKCS11::flags(), module(), and Botan::PKCS11::Slot::slot_id().
Botan::PKCS11::Session::Session | ( | Slot & | slot, |
SessionHandle | handle ) |
Takes ownership of a session.
Definition at line 22 of file p11_session.cpp.
References get_info(), Botan::PKCS11::RoPublicSession, Botan::PKCS11::RwPublicSession, and CK_SESSION_INFO::state.
|
default |
|
delete |
|
noexcept |
Logout user and close the session on destruction.
Definition at line 32 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_CloseSession(), Botan::PKCS11::LowLevel::C_Logout(), and module().
SessionInfo Botan::PKCS11::Session::get_info | ( | ) | const |
Definition at line 62 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_GetSessionInfo(), and module().
Referenced by Session().
|
inline |
Definition at line 154 of file p11_types.h.
Referenced by release().
void Botan::PKCS11::Session::init_pin | ( | const secure_string & | new_pin | ) |
Calls C_InitPIN
to change or initialize the PIN using the SO_PIN (requires a logged in session)
Definition at line 74 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_InitPIN(), and module().
Referenced by Botan::PKCS11::set_pin().
void Botan::PKCS11::Session::login | ( | UserType | userType, |
const secure_string & | pin ) |
Login to this session
userType | the user type to use for the login |
pin | the PIN of the user |
Definition at line 52 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_Login(), and module().
Referenced by Botan::PKCS11::change_pin(), Botan::PKCS11::change_so_pin(), and Botan::PKCS11::set_pin().
void Botan::PKCS11::Session::logoff | ( | ) |
Logout from this session.
Definition at line 57 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_Logout(), and module().
|
inline |
Definition at line 157 of file p11_types.h.
Referenced by get_info(), init_pin(), login(), logoff(), Session(), set_pin(), and ~Session().
SessionHandle Botan::PKCS11::Session::release | ( | ) |
Definition at line 46 of file p11_session.cpp.
References handle().
void Botan::PKCS11::Session::set_pin | ( | const secure_string & | old_pin, |
const secure_string & | new_pin ) |
Calls C_SetPIN
to change the PIN using the old PIN (requires a logged in session)
Definition at line 69 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_SetPIN(), and module().
Referenced by Botan::PKCS11::change_pin(), and Botan::PKCS11::change_so_pin().
|
inline |