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