|
Botan
2.13.0
Crypto and TLS for C++11
|
Represents a PKCS#11 session. More...
#include <p11_session.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) More... | |
| void | login (UserType userType, const secure_string &pin) |
| void | logoff () |
| Logout from this session. More... | |
| Module & | module () const |
| Session & | operator= (Session &&other)=delete |
| Session & | operator= (const Session &other)=delete |
| SessionHandle | release () |
| 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. More... | |
| Session (Session &&other)=default | |
| Session (const Session &other)=delete | |
| void | set_pin (const secure_string &old_pin, const secure_string &new_pin) const |
Calls C_SetPIN to change the PIN using the old PIN (requires a logged in session) More... | |
| const Slot & | slot () const |
| ~Session () noexcept | |
| Logout user and close the session on destruction. More... | |
Represents a PKCS#11 session.
Definition at line 21 of file p11_session.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 14 of file p11_session.cpp.
References Botan::PKCS11::None, Botan::PKCS11::RwSession, and Botan::PKCS11::SerialSession.
| 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 18 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 24 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 39 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 78 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_GetSessionInfo(), and module().
Referenced by Session().
|
inline |
Definition at line 58 of file p11_session.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 90 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 66 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 72 of file p11_session.cpp.
References Botan::PKCS11::LowLevel::C_Logout(), and module().
|
inline |
Definition at line 64 of file p11_session.h.
Referenced by get_info(), init_pin(), login(), logoff(), Session(), set_pin(), and ~Session().
| SessionHandle Botan::PKCS11::Session::release | ( | ) |
Definition at line 59 of file p11_session.cpp.
References handle().
| void Botan::PKCS11::Session::set_pin | ( | const secure_string & | old_pin, |
| const secure_string & | new_pin | ||
| ) | const |
Calls C_SetPIN to change the PIN using the old PIN (requires a logged in session)
Definition at line 85 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 |
Definition at line 52 of file p11_session.h.
1.8.9.1