Botan 3.9.0
Crypto and TLS for C&
p11_object.h
Go to the documentation of this file.
1/*
2* PKCS#11 Object
3* (C) 2016 Daniel Neus, Sirrix AG
4* (C) 2016 Philipp Weber, Sirrix AG
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#ifndef BOTAN_P11_OBJECT_H_
10#define BOTAN_P11_OBJECT_H_
11
12#include <botan/p11.h>
13#include <botan/p11_types.h>
14#include <botan/secmem.h>
15
16#include <concepts>
17#include <functional>
18#include <list>
19#include <string>
20#include <type_traits>
21#include <vector>
22
23namespace Botan::PKCS11 {
24
25class Module;
26
27/// Helper class to build the Attribute / CK_ATTRIBUTE structures
29 public:
30 AttributeContainer() = default;
31
32 /// @param object_class the class type of this container
34
35 virtual ~AttributeContainer() = default;
36
39
40 // Warning when implementing copy/assignment: m_attributes contains pointers to the other members which must be updated after a copy
41 AttributeContainer(const AttributeContainer& other) = delete;
43
44 /// @return the attributes this container contains
45 inline const std::vector<Attribute>& attributes() const { return m_attributes; }
46
47 /// @return raw attribute data
48 inline Attribute* data() const { return const_cast<Attribute*>(m_attributes.data()); }
49
50 /// @return the number of attributes in this container
51 inline size_t count() const { return m_attributes.size(); }
52
53 /**
54 * Add a class attribute (CKA_CLASS / AttributeType::Class).
55 * @param object_class class attribute to add
56 */
57 void add_class(ObjectClass object_class);
58
59 /**
60 * Add a string attribute (e.g. CKA_LABEL / AttributeType::Label).
61 * @param attribute attribute type
62 * @param value string value to add
63 */
64 void add_string(AttributeType attribute, std::string_view value);
65
66 /**
67 * Add a binary attribute (e.g. CKA_ID / AttributeType::Id).
68 * @param attribute attribute type
69 * @param value binary attribute value to add
70 * @param length size of the binary attribute value in bytes
71 */
72 void add_binary(AttributeType attribute, const uint8_t* value, size_t length);
73
74 /**
75 * Add a binary attribute (e.g. CKA_ID / AttributeType::Id).
76 * @param attribute attribute type
77 * @param binary binary attribute value to add
78 */
79 template <typename TAlloc>
80 void add_binary(AttributeType attribute, const std::vector<uint8_t, TAlloc>& binary) {
81 add_binary(attribute, binary.data(), binary.size());
82 }
83
84 /**
85 * Add a bool attribute (e.g. CKA_SENSITIVE / AttributeType::Sensitive).
86 * @param attribute attribute type
87 * @param value boolean value to add
88 */
89 void add_bool(AttributeType attribute, bool value);
90
91 /**
92 * Add a numeric attribute (e.g. CKA_MODULUS_BITS / AttributeType::ModulusBits).
93 * @param attribute attribute type
94 * @param value numeric value to add
95 */
96 template <std::integral T>
97 void add_numeric(AttributeType attribute, T value) {
98 m_numerics.push_back(static_cast<uint64_t>(value));
99 add_attribute(attribute, reinterpret_cast<uint8_t*>(&m_numerics.back()), sizeof(T));
100 }
101
102 protected:
103 /// Add an attribute with the given value and size to the attribute collection `m_attributes`
104 void add_attribute(AttributeType attribute, const uint8_t* value, Ulong size);
105
106 private:
107 std::vector<Attribute> m_attributes;
108 std::list<uint64_t> m_numerics;
109 std::list<std::string> m_strings;
110 std::list<secure_vector<uint8_t>> m_vectors;
111};
112
113/// Manages calls to C_FindObjects* functions (C_FindObjectsInit -> C_FindObjects -> C_FindObjectsFinal)
115 public:
116 /**
117 * Initializes a search for token and session objects that match a template (calls C_FindObjectsInit)
118 * @param session the session to use for the search
119 * @param search_template the search_template as a vector of `Attribute`
120 */
121 ObjectFinder(Session& session, const std::vector<Attribute>& search_template);
122
123 ObjectFinder(const ObjectFinder& other) = default;
124 ObjectFinder& operator=(const ObjectFinder& other) = delete;
125
126 ObjectFinder(ObjectFinder&& other) = default;
128
129 /// Terminates a search for token and session objects (calls C_FindObjectsFinal)
130 ~ObjectFinder() noexcept;
131
132 /**
133 * Starts or continues a search for token and session objects that match a template, obtaining additional object handles (calls C_FindObjects)
134 * @param max_count maximum amount of object handles to retrieve. Default = 100
135 * @return the result of the search as a vector of `ObjectHandle`
136 */
137 std::vector<ObjectHandle> find(std::uint32_t max_count = 100) const;
138
139 /// Finishes the search operation manually to allow a new ObjectFinder to exist
140 void finish();
141
142 /// @return the module this `ObjectFinder` belongs to
143 inline Module& module() const { return m_session.get().module(); }
144
145 private:
146 const std::reference_wrapper<Session> m_session;
147 bool m_search_terminated;
148};
149
150/// Common attributes of all objects
152 public:
153 /// @param object_class the object class of the object
155
156 /// @return the object class of this object
157 inline ObjectClass object_class() const { return m_object_class; }
158
159 private:
160 const ObjectClass m_object_class;
161};
162
163/// Common attributes of all storage objects
165 public:
166 /// @param object_class the CK_OBJECT_CLASS this storage object belongs to
168
169 /// @param label description of the object (RFC2279 string)
170 inline void set_label(std::string_view label) { add_string(AttributeType::Label, label); }
171
172 /// @param value if true the object is a token object; otherwise the object is a session object
173 inline void set_token(bool value) { add_bool(AttributeType::Token, value); }
174
175 /**
176 * @param value if true the object is a private object; otherwise the object is a public object
177 * When private, a user may not access the object until the user has been authenticated to the token
178 */
179 inline void set_private(bool value) { add_bool(AttributeType::Private, value); }
180
181 /// @param value if true the object can be modified, otherwise it is read-only
183
184 /// @param value if true the object can be copied using C_CopyObject
185 void set_copyable(bool value) { add_bool(AttributeType::Copyable, value); }
186
187 /// @param value if true the object can be destroyed using C_DestroyObject
189};
190
191/// Common attributes of all data objects
193 public:
195
196 /// @param value description of the application that manages the object (RFC2279 string)
197 inline void set_application(std::string_view value) { add_string(AttributeType::Application, value); }
198
199 /// @param object_id DER-encoding of the object identifier indicating the data object type
200 inline void set_object_id(const std::vector<uint8_t>& object_id) {
202 }
203
204 /// @param value value of the object
206};
207
208/// Common attributes of all certificate objects
210 public:
211 /// @param cert_type type of certificate
213
214 /// @param value the certificate can be trusted for the application that it was created (can only be set to true by SO user)
215 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
216
217 /// @param category one of `CertificateCategory`
221
222 /**
223 * @param checksum the value of this attribute is derived from the certificate by taking the
224 * first three bytes of the SHA - 1 hash of the certificate object's `CKA_VALUE` attribute
225 */
226 inline void set_check_value(const std::vector<uint8_t>& checksum) {
228 }
229
230 /// @param date start date for the certificate
231 inline void set_start_date(Date date) {
232 add_binary(AttributeType::StartDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
233 }
234
235 /// @param date end date for the certificate
236 inline void set_end_date(Date date) {
237 add_binary(AttributeType::EndDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
238 }
239
240 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for the public key contained in this certificate
241 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
243 }
244
245 /// @return the certificate type of this certificate object
246 inline CertificateType cert_type() const { return m_cert_type; }
247
248 private:
249 const CertificateType m_cert_type;
250};
251
252/// Common attributes of all key objects
254 public:
255 /**
256 * @param object_class the `CK_OBJECT_CLASS` this key object belongs to
257 * @param key_type type of key
258 */
260
261 /// @param id key identifier for key
262 inline void set_id(const std::vector<uint8_t>& id) { add_binary(AttributeType::Id, id); }
263
264 /// @param date start date for the key
265 inline void set_start_date(Date date) {
266 add_binary(AttributeType::StartDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
267 }
268
269 /// @param date end date for the key
270 inline void set_end_date(Date date) {
271 add_binary(AttributeType::EndDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
272 }
273
274 /// @param value true if key supports key derivation (i.e., if other keys can be derived from this one)
275 inline void set_derive(bool value) { add_bool(AttributeType::Derive, value); }
276
277 /**
278 * Sets a list of mechanisms allowed to be used with this key
279 * Not implemented
280 * TODO(Botan4) remove this
281 */
283 const std::vector<MechanismType>& /*mechanisms*/) { // NOLINT(*-convert-member-functions-to-static)
284 throw Not_Implemented("KeyProperties::set_allowed_mechanisms");
285 }
286
287 /// @return the key type of this key object
288 inline KeyType key_type() const { return m_key_type; }
289
290 private:
291 const KeyType m_key_type;
292};
293
294/// Common attributes of all public key objects
296 public:
297 /// @param key_type type of key
299
300 /// @param subject DER-encoding of the key subject name
301 inline void set_subject(const std::vector<uint8_t>& subject) { add_binary(AttributeType::Subject, subject); }
302
303 /// @param value true if the key supports encryption
304 inline void set_encrypt(bool value) { add_bool(AttributeType::Encrypt, value); }
305
306 /// @param value true if the key supports verification where the signature is an appendix to the data
307 inline void set_verify(bool value) { add_bool(AttributeType::Verify, value); }
308
309 /// @param value true if the key supports verification where the data is recovered from the signature
310 inline void set_verify_recover(bool value) { add_bool(AttributeType::VerifyRecover, value); }
311
312 /// @param value true if the key supports wrapping (i.e., can be used to wrap other keys)
313 inline void set_wrap(bool value) { add_bool(AttributeType::Wrap, value); }
314
315 /**
316 * @param value true if the key can be trusted for the application that it was created.
317 * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`
318 */
319 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
320
321 /**
322 * For wrapping keys
323 * The attribute template to match against any keys wrapped using this wrapping key.
324 * Keys that do not match cannot be wrapped
325 * Not implemented
326 * TODO(Botan4) remove this function
327 */
328 inline void set_wrap_template(
329 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
330 throw Not_Implemented("PublicKeyProperties::set_wrap_template");
331 }
332
333 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for this public key
334 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
336 }
337};
338
339/// Common attributes of all private keys
341 public:
342 /// @param key_type type of key
344
345 /// @param subject DER-encoding of the key subject name
346 inline void set_subject(const std::vector<uint8_t>& subject) { add_binary(AttributeType::Subject, subject); }
347
348 /// @param value true if the key is sensitive
349 inline void set_sensitive(bool value) { add_bool(AttributeType::Sensitive, value); }
350
351 /// @param value true if the key supports decryption
352 inline void set_decrypt(bool value) { add_bool(AttributeType::Decrypt, value); }
353
354 /// @param value true if the key supports signatures where the signature is an appendix to the data
355 inline void set_sign(bool value) { add_bool(AttributeType::Sign, value); }
356
357 /// @param value true if the key supports signatures where the data can be recovered from the signature
358 inline void set_sign_recover(bool value) { add_bool(AttributeType::SignRecover, value); }
359
360 /// @param value true if the key supports unwrapping (i.e., can be used to unwrap other keys)
361 inline void set_unwrap(bool value) { add_bool(AttributeType::Unwrap, value); }
362
363 /// @param value true if the key is extractable and can be wrapped
364 inline void set_extractable(bool value) { add_bool(AttributeType::Extractable, value); }
365
366 /// @param value true if the key can only be wrapped with a wrapping key that has `CKA_TRUSTED` set to `CK_TRUE`
368
369 /// @param value If true, the user has to supply the PIN for each use (sign or decrypt) with the key
371
372 /**
373 * For wrapping keys
374 * The attribute template to apply to any keys unwrapped using this wrapping key.
375 * Any user supplied template is applied after this template as if the object has already been created
376 * Not implemented
377 * TODO(Botan4) remove this function
378 */
380 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
381 throw Not_Implemented("PrivateKeyProperties::set_unwrap_template");
382 }
383
384 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for this public key
385 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
387 }
388};
389
390/// Common attributes of all secret (symmetric) keys
392 public:
393 /// @param key_type type of key
395
396 /// @param value true if the key is sensitive
397 inline void set_sensitive(bool value) { add_bool(AttributeType::Sensitive, value); }
398
399 /// @param value true if the key supports encryption
400 inline void set_encrypt(bool value) { add_bool(AttributeType::Encrypt, value); }
401
402 /// @param value true if the key supports decryption
403 inline void set_decrypt(bool value) { add_bool(AttributeType::Decrypt, value); }
404
405 /// @param value true if the key supports signatures where the signature is an appendix to the data
406 inline void set_sign(bool value) { add_bool(AttributeType::Sign, value); }
407
408 /// @param value true if the key supports verification where the signature is an appendix to the data
409 inline void set_verify(bool value) { add_bool(AttributeType::Verify, value); }
410
411 /// @param value true if the key supports unwrapping (i.e., can be used to unwrap other keys)
412 inline void set_unwrap(bool value) { add_bool(AttributeType::Unwrap, value); }
413
414 /// @param value true if the key is extractable and can be wrapped
415 inline void set_extractable(bool value) { add_bool(AttributeType::Extractable, value); }
416
417 /// @param value true if the key can only be wrapped with a wrapping key that has `CKA_TRUSTED` set to `CK_TRUE`
419
420 /// @param value if true, the user has to supply the PIN for each use (sign or decrypt) with the key
422
423 /// @param value true if the key supports wrapping (i.e., can be used to wrap other keys)
424 inline void set_wrap(bool value) { add_bool(AttributeType::Wrap, value); }
425
426 /**
427 * @param value the key can be trusted for the application that it was created.
428 * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`
429 */
430 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
431
432 /// @param checksum the key check value of this key
433 inline void set_check_value(const std::vector<uint8_t>& checksum) {
435 }
436
437 /**
438 * For wrapping keys
439 * The attribute template to match against any keys wrapped using this wrapping key.
440 * Keys that do not match cannot be wrapped
441 * Not implemented
442 * TODO(Botan4) remove this function
443 */
444 inline void set_wrap_template(
445 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
446 throw Not_Implemented("SecretKeyProperties::set_wrap_template");
447 }
448
449 /**
450 * For wrapping keys
451 * The attribute template to apply to any keys unwrapped using this wrapping key
452 * Any user supplied template is applied after this template as if the object has already been created
453 * Not Implemented
454 * TODO(Botan4) remove this function
455 */
457 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
458 throw Not_Implemented("SecretKeyProperties::set_unwrap_template");
459 }
460};
461
462/// Common attributes of domain parameter
464 public:
465 /// @param key_type type of key the domain parameters can be used to generate
467
468 /// @return the key type
469 inline KeyType key_type() const { return m_key_type; }
470
471 private:
472 const KeyType m_key_type;
473};
474
475/**
476* Represents a PKCS#11 object.
477*/
479 public:
480 /**
481 * Creates an `Object` from an existing PKCS#11 object
482 * @param session the session the object belongs to
483 * @param handle handle of the object
484 */
485
487
488 /**
489 * Creates the object
490 * @param session the session in which the object should be created
491 * @param obj_props properties of this object
492 */
493 Object(Session& session, const ObjectProperties& obj_props);
494
495 Object(const Object&) = default;
496 Object(Object&&) = default;
497 Object& operator=(const Object&) = delete;
498 Object& operator=(Object&&) = delete;
499
500 virtual ~Object() = default;
501
502 /// Searches for all objects of the given type that match `search_template`
503 template <typename T>
504 static std::vector<T> search(Session& session, const std::vector<Attribute>& search_template);
505
506 /// Searches for all objects of the given type using the label (`CKA_LABEL`)
507 template <typename T>
508 static std::vector<T> search(Session& session, std::string_view label);
509
510 /// Searches for all objects of the given type using the id (`CKA_ID`)
511 template <typename T>
512 static std::vector<T> search(Session& session, const std::vector<uint8_t>& id);
513
514 /// Searches for all objects of the given type using the label (`CKA_LABEL`) and id (`CKA_ID`)
515 template <typename T>
516 static std::vector<T> search(Session& session, std::string_view label, const std::vector<uint8_t>& id);
517
518 /// Searches for all objects of the given type
519 template <typename T>
520 static std::vector<T> search(Session& session);
521
522 /// @returns the value of the given attribute (using `C_GetAttributeValue`)
524
525 /// Sets the given value for the attribute (using `C_SetAttributeValue`)
526 void set_attribute_value(AttributeType attribute, const secure_vector<uint8_t>& value) const;
527
528 /// Destroys the object
529 void destroy() const;
530
531 /**
532 * Copies the object
533 * @param modified_attributes the attributes of the copied object
534 */
535 ObjectHandle copy(const AttributeContainer& modified_attributes) const;
536
537 /// @return the handle of this object.
538 inline ObjectHandle handle() const { return m_handle; }
539
540 /// @return the session this objects belongs to
541 inline Session& session() const { return m_session; }
542
543 /// @return the module this object belongs to
544 inline Module& module() const { return m_session.get().module(); }
545
546 protected:
547 explicit Object(Session& session) : m_session(session) {}
548
550 if(m_handle != CK_INVALID_HANDLE) {
551 throw Invalid_Argument("Cannot reset handle on already valid PKCS11 object");
552 }
553 m_handle = handle;
554 }
555
556 private:
557 const std::reference_wrapper<Session> m_session;
559};
560
561template <typename T>
562std::vector<T> Object::search(Session& session, const std::vector<Attribute>& search_template) {
563 ObjectFinder finder(session, search_template);
564 std::vector<ObjectHandle> handles = finder.find();
565 std::vector<T> result;
566 result.reserve(handles.size());
567 for(const auto& handle : handles) {
568 result.emplace_back(T(session, handle));
569 }
570 return result;
571}
572
573template <typename T>
574std::vector<T> Object::search(Session& session, std::string_view label) {
575 AttributeContainer search_template(T::Class);
576 search_template.add_string(AttributeType::Label, label);
577 return search<T>(session, search_template.attributes());
578}
579
580template <typename T>
581std::vector<T> Object::search(Session& session, const std::vector<uint8_t>& id) {
582 AttributeContainer search_template(T::Class);
583 search_template.add_binary(AttributeType::Id, id);
584 return search<T>(session, search_template.attributes());
585}
586
587template <typename T>
588std::vector<T> Object::search(Session& session, std::string_view label, const std::vector<uint8_t>& id) {
589 AttributeContainer search_template(T::Class);
590 search_template.add_string(AttributeType::Label, label);
591 search_template.add_binary(AttributeType::Id, id);
592 return search<T>(session, search_template.attributes());
593}
594
595template <typename T>
597 return search<T>(session, AttributeContainer(T::Class).attributes());
598}
599
600} // namespace Botan::PKCS11
601
602#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:21
#define BOTAN_FUTURE_EXPLICIT
Definition api.h:52
Helper class to build the Attribute / CK_ATTRIBUTE structures.
Definition p11_object.h:28
AttributeContainer & operator=(const AttributeContainer &other)=delete
AttributeContainer & operator=(AttributeContainer &&other)=default
virtual ~AttributeContainer()=default
void add_attribute(AttributeType attribute, const uint8_t *value, Ulong size)
Add an attribute with the given value and size to the attribute collection m_attributes
void add_numeric(AttributeType attribute, T value)
Definition p11_object.h:97
void add_bool(AttributeType attribute, bool value)
AttributeContainer(AttributeContainer &&other)=default
const std::vector< Attribute > & attributes() const
Definition p11_object.h:45
void add_binary(AttributeType attribute, const std::vector< uint8_t, TAlloc > &binary)
Definition p11_object.h:80
void add_string(AttributeType attribute, std::string_view value)
void add_binary(AttributeType attribute, const uint8_t *value, size_t length)
AttributeContainer(const AttributeContainer &other)=delete
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:241
BOTAN_FUTURE_EXPLICIT CertificateProperties(CertificateType cert_type)
void set_check_value(const std::vector< uint8_t > &checksum)
Definition p11_object.h:226
CertificateType cert_type() const
Definition p11_object.h:246
void set_category(CertificateCategory category)
Definition p11_object.h:218
void set_application(std::string_view value)
Definition p11_object.h:197
void set_value(const secure_vector< uint8_t > &value)
Definition p11_object.h:205
void set_object_id(const std::vector< uint8_t > &object_id)
Definition p11_object.h:200
BOTAN_FUTURE_EXPLICIT DomainParameterProperties(KeyType key_type)
void set_derive(bool value)
Definition p11_object.h:275
void set_id(const std::vector< uint8_t > &id)
Definition p11_object.h:262
void set_start_date(Date date)
Definition p11_object.h:265
void set_end_date(Date date)
Definition p11_object.h:270
void set_allowed_mechanisms(const std::vector< MechanismType > &)
Definition p11_object.h:282
KeyProperties(ObjectClass object_class, KeyType key_type)
Manages calls to C_FindObjects* functions (C_FindObjectsInit -> C_FindObjects -> C_FindObjectsFinal)
Definition p11_object.h:114
ObjectFinder(const ObjectFinder &other)=default
std::vector< ObjectHandle > find(std::uint32_t max_count=100) const
ObjectFinder & operator=(ObjectFinder &&other)=delete
Module & module() const
Definition p11_object.h:143
void finish()
Finishes the search operation manually to allow a new ObjectFinder to exist.
ObjectFinder & operator=(const ObjectFinder &other)=delete
ObjectFinder(ObjectFinder &&other)=default
ObjectFinder(Session &session, const std::vector< Attribute > &search_template)
Common attributes of all objects.
Definition p11_object.h:151
ObjectClass object_class() const
Definition p11_object.h:157
BOTAN_FUTURE_EXPLICIT ObjectProperties(ObjectClass object_class)
void reset_handle(ObjectHandle handle)
Definition p11_object.h:549
Module & module() const
Definition p11_object.h:544
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
Definition p11_object.h:562
Object(Object &&)=default
Object & operator=(const Object &)=delete
ObjectHandle handle() const
Definition p11_object.h:538
virtual ~Object()=default
Session & session() const
Definition p11_object.h:541
Object & operator=(Object &&)=delete
secure_vector< uint8_t > get_attribute_value(AttributeType attribute) const
void destroy() const
Destroys the object.
Object(Session &session, ObjectHandle handle)
void set_attribute_value(AttributeType attribute, const secure_vector< uint8_t > &value) const
Sets the given value for the attribute (using C_SetAttributeValue)
Object(const Object &)=default
Object(Session &session)
Definition p11_object.h:547
ObjectHandle copy(const AttributeContainer &modified_attributes) const
BOTAN_FUTURE_EXPLICIT PrivateKeyProperties(KeyType key_type)
void set_subject(const std::vector< uint8_t > &subject)
Definition p11_object.h:346
void set_always_authenticate(bool value)
Definition p11_object.h:370
void set_unwrap_template(const AttributeContainer &)
Definition p11_object.h:379
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:385
BOTAN_FUTURE_EXPLICIT PublicKeyProperties(KeyType key_type)
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:334
void set_subject(const std::vector< uint8_t > &subject)
Definition p11_object.h:301
void set_wrap_template(const AttributeContainer &)
Definition p11_object.h:328
void set_check_value(const std::vector< uint8_t > &checksum)
Definition p11_object.h:433
void set_unwrap_template(const AttributeContainer &)
Definition p11_object.h:456
void set_wrap_template(const AttributeContainer &)
Definition p11_object.h:444
BOTAN_FUTURE_EXPLICIT SecretKeyProperties(KeyType key_type)
void set_wrap_with_trusted(bool value)
Definition p11_object.h:418
void set_always_authenticate(bool value)
Definition p11_object.h:421
Represents a PKCS#11 session.
Definition p11_types.h:122
void set_label(std::string_view label)
Definition p11_object.h:170
BOTAN_FUTURE_EXPLICIT StorageObjectProperties(ObjectClass object_class)
AttributeType
Definition p11.h:68
CertificateType
Definition p11.h:179
CK_OBJECT_HANDLE ObjectHandle
Definition p11.h:835
CK_ATTRIBUTE Attribute
Definition p11.h:834
CK_DATE Date
Definition p11.h:840
CK_ULONG Ulong
Definition p11.h:825
CertificateCategory
Definition p11.h:188
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:69
#define CK_INVALID_HANDLE
Definition pkcs11t.h:75
CK_ULONG CK_CERTIFICATE_CATEGORY
Definition pkcs11t.h:1923