|
Botan 3.14.1
Crypto and TLS for C&
|
#include <p11_object.h>
Public Member Functions | |
| ObjectHandle | copy (const AttributeContainer &modified_attributes) const |
| void | destroy () const |
| secure_vector< uint8_t > | get_attribute_value (AttributeType attribute) const |
| ObjectHandle | handle () const |
| Module & | module () const |
| Object (const Object &)=default | |
| Object (Object &&)=default | |
| Object (Session &session, const ObjectProperties &obj_props) | |
| Object (Session &session, ObjectHandle handle) | |
| Object & | operator= (const Object &)=delete |
| Object & | operator= (Object &&)=delete |
| Session & | session () const |
| void | set_attribute_value (AttributeType attribute, const secure_vector< uint8_t > &value) const |
| Sets the given value for the attribute (using C_SetAttributeValue). | |
| virtual | ~Object ()=default |
Static Public Member Functions | |
| template<typename T> | |
| static std::vector< T > | search (Session &session) |
| Searches for all objects of the given type. | |
| template<typename T> | |
| static std::vector< T > | search (Session &session, const std::vector< Attribute > &search_template) |
| Searches for all objects of the given type that match search_template. | |
| template<typename T> | |
| static std::vector< T > | search (Session &session, const std::vector< uint8_t > &id) |
| Searches for all objects of the given type using the id (CKA_ID). | |
| template<typename T> | |
| static std::vector< T > | search (Session &session, std::string_view label) |
| Searches for all objects of the given type using the label (CKA_LABEL). | |
| template<typename T> | |
| static std::vector< T > | search (Session &session, std::string_view label, const std::vector< uint8_t > &id) |
| Searches for all objects of the given type using the label (CKA_LABEL) and id (CKA_ID). | |
Protected Member Functions | |
| Object (Session &session) | |
| void | reset_handle (ObjectHandle handle) |
Static Protected Member Functions | |
| template<typename T> | |
| static AttributeContainer | search_template_for () |
| The search template matching all objects of type T. | |
Represents a PKCS#11 object.
Definition at line 488 of file p11_object.h.
| Botan::PKCS11::Object::Object | ( | Session & | session, |
| ObjectHandle | handle ) |
Creates an Object from an existing PKCS#11 object
Definition at line 155 of file p11_object.cpp.
References handle(), and session().
Referenced by Object(), Object(), operator=(), and operator=().
| Botan::PKCS11::Object::Object | ( | Session & | session, |
| const ObjectProperties & | obj_props ) |
Creates the object
| session | the session in which the object should be created |
| obj_props | properties of this object |
Definition at line 157 of file p11_object.cpp.
References C_CreateObject(), Botan::PKCS11::checked_ulong_cast(), Botan::PKCS11::AttributeContainer::count(), Botan::PKCS11::AttributeContainer::data(), module(), and session().
|
default |
References Object().
|
default |
References Object().
|
virtualdefault |
References copy(), destroy(), get_attribute_value(), search(), session(), and set_attribute_value().
|
inlineexplicitprotected |
| ObjectHandle Botan::PKCS11::Object::copy | ( | const AttributeContainer & | modified_attributes | ) | const |
Copies the object
| modified_attributes | the attributes of the copied object |
Definition at line 179 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_CopyObject(), Botan::PKCS11::checked_ulong_cast(), Botan::PKCS11::AttributeContainer::count(), Botan::PKCS11::AttributeContainer::data(), and module().
Referenced by ~Object().
| void Botan::PKCS11::Object::destroy | ( | ) | const |
Destroys the object
Afterwards handle() returns CK_INVALID_HANDLE. Copies of this object made earlier still hold the old handle and must no longer be used.
Definition at line 173 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_DestroyObject(), CK_INVALID_HANDLE, and module().
Referenced by ~Object().
| secure_vector< uint8_t > Botan::PKCS11::Object::get_attribute_value | ( | AttributeType | attribute | ) | const |
Definition at line 162 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_GetAttributeValue(), and module().
Referenced by ~Object().
|
inline |
Definition at line 553 of file p11_object.h.
Referenced by Object(), reset_handle(), and search().
|
inline |
Definition at line 559 of file p11_object.h.
Referenced by copy(), destroy(), get_attribute_value(), Object(), and set_attribute_value().
|
inlineprotected |
Definition at line 575 of file p11_object.h.
References CK_INVALID_HANDLE, and handle().
|
static |
Searches for all objects of the given type.
Definition at line 630 of file p11_object.h.
References search(), search_template_for(), and session().
|
static |
Searches for all objects of the given type that match search_template.
Definition at line 589 of file p11_object.h.
References Botan::PKCS11::ObjectFinder::find(), handle(), and session().
Referenced by search(), search(), search(), search(), and ~Object().
|
static |
Searches for all objects of the given type using the id (CKA_ID).
Definition at line 615 of file p11_object.h.
References Botan::PKCS11::AttributeContainer::add_binary(), Botan::PKCS11::AttributeContainer::attributes(), Botan::PKCS11::Id, search(), search_template_for(), and session().
|
static |
Searches for all objects of the given type using the label (CKA_LABEL).
Definition at line 608 of file p11_object.h.
References Botan::PKCS11::AttributeContainer::add_string(), Botan::PKCS11::AttributeContainer::attributes(), Botan::PKCS11::Label, search(), search_template_for(), and session().
|
static |
Searches for all objects of the given type using the label (CKA_LABEL) and id (CKA_ID).
Definition at line 622 of file p11_object.h.
References Botan::PKCS11::AttributeContainer::add_binary(), Botan::PKCS11::AttributeContainer::add_string(), Botan::PKCS11::AttributeContainer::attributes(), Botan::PKCS11::Id, Botan::PKCS11::Label, search(), search_template_for(), and session().
|
inlinestaticprotected |
The search template matching all objects of type T.
Definition at line 566 of file p11_object.h.
References Botan::PKCS11::AttributeContainer::add_numeric(), and Botan::PKCS11::KeyType.
|
inline |
| void Botan::PKCS11::Object::set_attribute_value | ( | AttributeType | attribute, |
| const secure_vector< uint8_t > & | value ) const |
Sets the given value for the attribute (using C_SetAttributeValue).
Definition at line 168 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_SetAttributeValue(), and module().
Referenced by ~Object().