Botan 3.6.1
Crypto and TLS for C&
|
#include <p11_object.h>
Public Member Functions | |
ObjectHandle | copy (const AttributeContainer &modified_attributes) const |
void | destroy () const |
Destroys the object. | |
secure_vector< uint8_t > | get_attribute_value (AttributeType attribute) const |
ObjectHandle | handle () const |
Module & | module () const |
Object (const Object &)=default | |
Object (Session &session, const ObjectProperties &obj_props) | |
Object (Session &session, ObjectHandle handle) | |
Object & | operator= (const 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) |
Represents a PKCS#11 object.
Definition at line 468 of file p11_object.h.
Botan::PKCS11::Object::Object | ( | Session & | session, |
ObjectHandle | handle ) |
Creates an Object
from an existing PKCS#11 object
session | the session the object belongs to |
handle | handle of the object |
Definition at line 150 of file p11_object.cpp.
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 152 of file p11_object.cpp.
References Botan::PKCS11::AttributeContainer::count(), Botan::PKCS11::AttributeContainer::data(), and module().
|
default |
|
virtualdefault |
|
inlineprotected |
Definition at line 534 of file p11_object.h.
ObjectHandle Botan::PKCS11::Object::copy | ( | const AttributeContainer & | modified_attributes | ) | const |
Copies the object
modified_attributes | the attributes of the copied object |
Definition at line 172 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_CopyObject(), Botan::PKCS11::AttributeContainer::count(), Botan::PKCS11::AttributeContainer::data(), and module().
void Botan::PKCS11::Object::destroy | ( | ) | const |
Destroys the object.
Definition at line 168 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_DestroyObject(), and module().
secure_vector< uint8_t > Botan::PKCS11::Object::get_attribute_value | ( | AttributeType | attribute | ) | const |
C_GetAttributeValue
) Definition at line 157 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_GetAttributeValue(), and module().
|
inline |
Definition at line 525 of file p11_object.h.
Referenced by search().
|
inline |
Definition at line 531 of file p11_object.h.
Referenced by copy(), destroy(), get_attribute_value(), Object(), and set_attribute_value().
|
inlineprotected |
Definition at line 536 of file p11_object.h.
References CK_INVALID_HANDLE.
Searches for all objects of the given type.
Definition at line 583 of file p11_object.h.
|
static |
Searches for all objects of the given type that match search_template
Definition at line 549 of file p11_object.h.
References Botan::PKCS11::ObjectFinder::find(), handle(), session(), and T.
|
static |
Searches for all objects of the given type using the id (CKA_ID
)
Definition at line 568 of file p11_object.h.
References Botan::PKCS11::AttributeContainer::add_binary(), Botan::PKCS11::AttributeContainer::attributes(), Botan::PKCS11::Id, search(), and session().
|
static |
Searches for all objects of the given type using the label (CKA_LABEL
)
Definition at line 561 of file p11_object.h.
References Botan::PKCS11::AttributeContainer::add_string(), Botan::PKCS11::AttributeContainer::attributes(), Botan::PKCS11::Label, search(), and session().
|
static |
Searches for all objects of the given type using the label (CKA_LABEL
) and id (CKA_ID
)
Definition at line 575 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(), and session().
|
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 163 of file p11_object.cpp.
References Botan::PKCS11::LowLevel::C_SetAttributeValue(), and module().