Botan 3.13.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) = delete;
123 ObjectFinder& operator=(const ObjectFinder& other) = delete;
124
125 ObjectFinder(ObjectFinder&& other) noexcept :
126 m_session(other.m_session), m_search_terminated(other.m_search_terminated) {
127 other.m_search_terminated = true;
128 }
129
131
132 /// Terminates a search for token and session objects (calls C_FindObjectsFinal)
133 ~ObjectFinder() noexcept;
134
135 /**
136 * Starts or continues a search for token and session objects that match a template, obtaining additional object handles (calls C_FindObjects)
137 * @param max_count maximum amount of object handles to retrieve. Default = 100
138 * @return the result of the search as a vector of `ObjectHandle`
139 */
140 std::vector<ObjectHandle> find(std::uint32_t max_count = 100) const;
141
142 /// Finishes the search operation manually to allow a new ObjectFinder to exist
143 void finish();
144
145 /// @return the module this `ObjectFinder` belongs to
146 inline Module& module() const { return m_session.get().module(); }
147
148 private:
149 const std::reference_wrapper<Session> m_session;
150 bool m_search_terminated;
151};
152
153/// Common attributes of all objects
155 public:
156 /// @param object_class the object class of the object
158
159 /// @return the object class of this object
160 inline ObjectClass object_class() const { return m_object_class; }
161
162 private:
163 const ObjectClass m_object_class;
164};
165
166/// Common attributes of all storage objects
168 public:
169 /// @param object_class the CK_OBJECT_CLASS this storage object belongs to
171
172 /// @param label description of the object (RFC2279 string)
173 inline void set_label(std::string_view label) { add_string(AttributeType::Label, label); }
174
175 /// @param value if true the object is a token object; otherwise the object is a session object
176 inline void set_token(bool value) { add_bool(AttributeType::Token, value); }
177
178 /**
179 * @param value if true the object is a private object; otherwise the object is a public object
180 * When private, a user may not access the object until the user has been authenticated to the token
181 */
182 inline void set_private(bool value) { add_bool(AttributeType::Private, value); }
183
184 /// @param value if true the object can be modified, otherwise it is read-only
186
187 /// @param value if true the object can be copied using C_CopyObject
188 void set_copyable(bool value) { add_bool(AttributeType::Copyable, value); }
189
190 /// @param value if true the object can be destroyed using C_DestroyObject
192};
193
194/// Common attributes of all data objects
196 public:
198
199 /// @param value description of the application that manages the object (RFC2279 string)
200 inline void set_application(std::string_view value) { add_string(AttributeType::Application, value); }
201
202 /// @param object_id DER-encoding of the object identifier indicating the data object type
203 inline void set_object_id(const std::vector<uint8_t>& object_id) {
205 }
206
207 /// @param value value of the object
209};
210
211/// Common attributes of all certificate objects
213 public:
214 /// @param cert_type type of certificate
216
217 /// @param value the certificate can be trusted for the application that it was created (can only be set to true by SO user)
218 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
219
220 /// @param category one of `CertificateCategory`
224
225 /**
226 * @param checksum the value of this attribute is derived from the certificate by taking the
227 * first three bytes of the SHA - 1 hash of the certificate object's `CKA_VALUE` attribute
228 */
229 inline void set_check_value(const std::vector<uint8_t>& checksum) {
231 }
232
233 /// @param date start date for the certificate
234 inline void set_start_date(Date date) {
235 add_binary(AttributeType::StartDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
236 }
237
238 /// @param date end date for the certificate
239 inline void set_end_date(Date date) {
240 add_binary(AttributeType::EndDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
241 }
242
243 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for the public key contained in this certificate
244 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
246 }
247
248 /// @return the certificate type of this certificate object
249 inline CertificateType cert_type() const { return m_cert_type; }
250
251 private:
252 const CertificateType m_cert_type;
253};
254
255/// Common attributes of all key objects
257 public:
258 /**
259 * @param object_class the `CK_OBJECT_CLASS` this key object belongs to
260 * @param key_type type of key
261 */
263
264 /// @param id key identifier for key
265 inline void set_id(const std::vector<uint8_t>& id) { add_binary(AttributeType::Id, id); }
266
267 /// @param date start date for the key
268 inline void set_start_date(Date date) {
269 add_binary(AttributeType::StartDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
270 }
271
272 /// @param date end date for the key
273 inline void set_end_date(Date date) {
274 add_binary(AttributeType::EndDate, reinterpret_cast<uint8_t*>(&date), sizeof(Date));
275 }
276
277 /// @param value true if key supports key derivation (i.e., if other keys can be derived from this one)
278 inline void set_derive(bool value) { add_bool(AttributeType::Derive, value); }
279
280 /**
281 * Sets a list of mechanisms allowed to be used with this key
282 * Not implemented
283 * TODO(Botan4) remove this
284 */
286 const std::vector<MechanismType>& /*mechanisms*/) { // NOLINT(*-convert-member-functions-to-static)
287 throw Not_Implemented("KeyProperties::set_allowed_mechanisms");
288 }
289
290 /// @return the key type of this key object
291 inline KeyType key_type() const { return m_key_type; }
292
293 private:
294 const KeyType m_key_type;
295};
296
297/// Common attributes of all public key objects
299 public:
300 /// @param key_type type of key
302
303 /// @param subject DER-encoding of the key subject name
304 inline void set_subject(const std::vector<uint8_t>& subject) { add_binary(AttributeType::Subject, subject); }
305
306 /// @param value true if the key supports encryption
307 inline void set_encrypt(bool value) { add_bool(AttributeType::Encrypt, value); }
308
309 /// @param value true if the key supports verification where the signature is an appendix to the data
310 inline void set_verify(bool value) { add_bool(AttributeType::Verify, value); }
311
312 /// @param value true if the key supports verification where the data is recovered from the signature
313 inline void set_verify_recover(bool value) { add_bool(AttributeType::VerifyRecover, value); }
314
315 /// @param value true if the key supports wrapping (i.e., can be used to wrap other keys)
316 inline void set_wrap(bool value) { add_bool(AttributeType::Wrap, value); }
317
318 /**
319 * @param value true if the key can be trusted for the application that it was created.
320 * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`
321 */
322 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
323
324 /**
325 * For wrapping keys
326 * The attribute template to match against any keys wrapped using this wrapping key.
327 * Keys that do not match cannot be wrapped
328 * Not implemented
329 * TODO(Botan4) remove this function
330 */
331 inline void set_wrap_template(
332 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
333 throw Not_Implemented("PublicKeyProperties::set_wrap_template");
334 }
335
336 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for this public key
337 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
339 }
340};
341
342/// Common attributes of all private keys
344 public:
345 /// @param key_type type of key
347
348 /// @param subject DER-encoding of the key subject name
349 inline void set_subject(const std::vector<uint8_t>& subject) { add_binary(AttributeType::Subject, subject); }
350
351 /// @param value true if the key is sensitive
352 inline void set_sensitive(bool value) { add_bool(AttributeType::Sensitive, value); }
353
354 /// @param value true if the key supports decryption
355 inline void set_decrypt(bool value) { add_bool(AttributeType::Decrypt, value); }
356
357 /// @param value true if the key supports signatures where the signature is an appendix to the data
358 inline void set_sign(bool value) { add_bool(AttributeType::Sign, value); }
359
360 /// @param value true if the key supports signatures where the data can be recovered from the signature
361 inline void set_sign_recover(bool value) { add_bool(AttributeType::SignRecover, value); }
362
363 /// @param value true if the key supports unwrapping (i.e., can be used to unwrap other keys)
364 inline void set_unwrap(bool value) { add_bool(AttributeType::Unwrap, value); }
365
366 /// @param value true if the key is extractable and can be wrapped
367 inline void set_extractable(bool value) { add_bool(AttributeType::Extractable, value); }
368
369 /// @param value true if the key can only be wrapped with a wrapping key that has `CKA_TRUSTED` set to `CK_TRUE`
371
372 /// @param value If true, the user has to supply the PIN for each use (sign or decrypt) with the key
374
375 /**
376 * For wrapping keys
377 * The attribute template to apply to any keys unwrapped using this wrapping key.
378 * Any user supplied template is applied after this template as if the object has already been created
379 * Not implemented
380 * TODO(Botan4) remove this function
381 */
383 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
384 throw Not_Implemented("PrivateKeyProperties::set_unwrap_template");
385 }
386
387 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for this public key
388 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
390 }
391};
392
393/// Common attributes of all secret (symmetric) keys
395 public:
396 /// @param key_type type of key
398
399 /// @param value true if the key is sensitive
400 inline void set_sensitive(bool value) { add_bool(AttributeType::Sensitive, value); }
401
402 /// @param value true if the key supports encryption
403 inline void set_encrypt(bool value) { add_bool(AttributeType::Encrypt, value); }
404
405 /// @param value true if the key supports decryption
406 inline void set_decrypt(bool value) { add_bool(AttributeType::Decrypt, value); }
407
408 /// @param value true if the key supports signatures where the signature is an appendix to the data
409 inline void set_sign(bool value) { add_bool(AttributeType::Sign, value); }
410
411 /// @param value true if the key supports verification where the signature is an appendix to the data
412 inline void set_verify(bool value) { add_bool(AttributeType::Verify, value); }
413
414 /// @param value true if the key supports unwrapping (i.e., can be used to unwrap other keys)
415 inline void set_unwrap(bool value) { add_bool(AttributeType::Unwrap, value); }
416
417 /// @param value true if the key is extractable and can be wrapped
418 inline void set_extractable(bool value) { add_bool(AttributeType::Extractable, value); }
419
420 /// @param value true if the key can only be wrapped with a wrapping key that has `CKA_TRUSTED` set to `CK_TRUE`
422
423 /// @param value if true, the user has to supply the PIN for each use (sign or decrypt) with the key
425
426 /// @param value true if the key supports wrapping (i.e., can be used to wrap other keys)
427 inline void set_wrap(bool value) { add_bool(AttributeType::Wrap, value); }
428
429 /**
430 * @param value the key can be trusted for the application that it was created.
431 * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`
432 */
433 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
434
435 /// @param checksum the key check value of this key
436 inline void set_check_value(const std::vector<uint8_t>& checksum) {
438 }
439
440 /**
441 * For wrapping keys
442 * The attribute template to match against any keys wrapped using this wrapping key.
443 * Keys that do not match cannot be wrapped
444 * Not implemented
445 * TODO(Botan4) remove this function
446 */
447 inline void set_wrap_template(
448 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
449 throw Not_Implemented("SecretKeyProperties::set_wrap_template");
450 }
451
452 /**
453 * For wrapping keys
454 * The attribute template to apply to any keys unwrapped using this wrapping key
455 * Any user supplied template is applied after this template as if the object has already been created
456 * Not Implemented
457 * TODO(Botan4) remove this function
458 */
460 const AttributeContainer& /*unused*/) { // NOLINT(*-convert-member-functions-to-static)
461 throw Not_Implemented("SecretKeyProperties::set_unwrap_template");
462 }
463};
464
465/// Common attributes of domain parameter
467 public:
468 /// @param key_type type of key the domain parameters can be used to generate
470
471 /// @return the key type
472 inline KeyType key_type() const { return m_key_type; }
473
474 private:
475 const KeyType m_key_type;
476};
477
478/**
479* Represents a PKCS#11 object.
480*/
482 public:
483 /**
484 * Creates an `Object` from an existing PKCS#11 object
485 * @param session the session the object belongs to
486 * @param handle handle of the object
487 */
488
490
491 /**
492 * Creates the object
493 * @param session the session in which the object should be created
494 * @param obj_props properties of this object
495 */
496 Object(Session& session, const ObjectProperties& obj_props);
497
498 Object(const Object&) = default;
499 Object(Object&&) = default;
500 Object& operator=(const Object&) = delete;
501 Object& operator=(Object&&) = delete;
502
503 virtual ~Object() = default;
504
505 /// Searches for all objects of the given type that match `search_template`
506 template <typename T>
507 static std::vector<T> search(Session& session, const std::vector<Attribute>& search_template);
508
509 /// Searches for all objects of the given type using the label (`CKA_LABEL`)
510 template <typename T>
511 static std::vector<T> search(Session& session, std::string_view label);
512
513 /// Searches for all objects of the given type using the id (`CKA_ID`)
514 template <typename T>
515 static std::vector<T> search(Session& session, const std::vector<uint8_t>& id);
516
517 /// Searches for all objects of the given type using the label (`CKA_LABEL`) and id (`CKA_ID`)
518 template <typename T>
519 static std::vector<T> search(Session& session, std::string_view label, const std::vector<uint8_t>& id);
520
521 /// Searches for all objects of the given type
522 template <typename T>
523 static std::vector<T> search(Session& session);
524
525 /// @returns the value of the given attribute (using `C_GetAttributeValue`)
527
528 /// Sets the given value for the attribute (using `C_SetAttributeValue`)
529 void set_attribute_value(AttributeType attribute, const secure_vector<uint8_t>& value) const;
530
531 /// Destroys the object
532 void destroy() const;
533
534 /**
535 * Copies the object
536 * @param modified_attributes the attributes of the copied object
537 */
538 ObjectHandle copy(const AttributeContainer& modified_attributes) const;
539
540 /// @return the handle of this object.
541 inline ObjectHandle handle() const { return m_handle; }
542
543 /// @return the session this objects belongs to
544 inline Session& session() const { return m_session; }
545
546 /// @return the module this object belongs to
547 inline Module& module() const { return m_session.get().module(); }
548
549 protected:
550 explicit Object(Session& session) : m_session(session) {}
551
553 if(m_handle != CK_INVALID_HANDLE) {
554 throw Invalid_Argument("Cannot reset handle on already valid PKCS11 object");
555 }
556 m_handle = handle;
557 }
558
559 private:
560 const std::reference_wrapper<Session> m_session;
562};
563
564template <typename T>
565std::vector<T> Object::search(Session& session, const std::vector<Attribute>& search_template) {
566 const ObjectFinder finder(session, search_template);
567 std::vector<T> result;
568 // C_FindObjects returns up to the requested batch; the search is exhausted
569 // when a call yields zero handles. Loop until then so callers see all matches.
570 for(;;) {
571 const std::vector<ObjectHandle> handles = finder.find();
572 if(handles.empty()) {
573 break;
574 }
575 result.reserve(result.size() + handles.size());
576 for(const auto& handle : handles) {
577 result.emplace_back(T(session, handle));
578 }
579 }
580 return result;
581}
582
583template <typename T>
584std::vector<T> Object::search(Session& session, std::string_view label) {
585 AttributeContainer search_template(T::Class);
586 search_template.add_string(AttributeType::Label, label);
587 return search<T>(session, search_template.attributes());
588}
589
590template <typename T>
591std::vector<T> Object::search(Session& session, const std::vector<uint8_t>& id) {
592 AttributeContainer search_template(T::Class);
593 search_template.add_binary(AttributeType::Id, id);
594 return search<T>(session, search_template.attributes());
595}
596
597template <typename T>
598std::vector<T> Object::search(Session& session, std::string_view label, const std::vector<uint8_t>& id) {
599 AttributeContainer search_template(T::Class);
600 search_template.add_string(AttributeType::Label, label);
601 search_template.add_binary(AttributeType::Id, id);
602 return search<T>(session, search_template.attributes());
603}
604
605template <typename T>
607 return search<T>(session, AttributeContainer(T::Class).attributes());
608}
609
610} // namespace Botan::PKCS11
611
612#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:244
BOTAN_FUTURE_EXPLICIT CertificateProperties(CertificateType cert_type)
void set_check_value(const std::vector< uint8_t > &checksum)
Definition p11_object.h:229
CertificateType cert_type() const
Definition p11_object.h:249
void set_category(CertificateCategory category)
Definition p11_object.h:221
void set_application(std::string_view value)
Definition p11_object.h:200
void set_value(const secure_vector< uint8_t > &value)
Definition p11_object.h:208
void set_object_id(const std::vector< uint8_t > &object_id)
Definition p11_object.h:203
BOTAN_FUTURE_EXPLICIT DomainParameterProperties(KeyType key_type)
void set_derive(bool value)
Definition p11_object.h:278
void set_id(const std::vector< uint8_t > &id)
Definition p11_object.h:265
void set_start_date(Date date)
Definition p11_object.h:268
void set_end_date(Date date)
Definition p11_object.h:273
void set_allowed_mechanisms(const std::vector< MechanismType > &)
Definition p11_object.h:285
KeyProperties(ObjectClass object_class, KeyType key_type)
Manages calls to C_FindObjects* functions (C_FindObjectsInit -> C_FindObjects -> C_FindObjectsFinal).
Definition p11_object.h:113
std::vector< ObjectHandle > find(std::uint32_t max_count=100) const
ObjectFinder & operator=(ObjectFinder &&other)=delete
Module & module() const
Definition p11_object.h:146
void finish()
Finishes the search operation manually to allow a new ObjectFinder to exist.
ObjectFinder(ObjectFinder &&other) noexcept
Definition p11_object.h:125
ObjectFinder & operator=(const ObjectFinder &other)=delete
ObjectFinder(const ObjectFinder &other)=delete
ObjectFinder(Session &session, const std::vector< Attribute > &search_template)
Common attributes of all objects.
Definition p11_object.h:154
ObjectClass object_class() const
Definition p11_object.h:160
BOTAN_FUTURE_EXPLICIT ObjectProperties(ObjectClass object_class)
void reset_handle(ObjectHandle handle)
Definition p11_object.h:552
Module & module() const
Definition p11_object.h:547
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:565
Object(Object &&)=default
Object & operator=(const Object &)=delete
ObjectHandle handle() const
Definition p11_object.h:541
virtual ~Object()=default
Session & session() const
Definition p11_object.h:544
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:550
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:349
void set_always_authenticate(bool value)
Definition p11_object.h:373
void set_unwrap_template(const AttributeContainer &)
Definition p11_object.h:382
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:388
BOTAN_FUTURE_EXPLICIT PublicKeyProperties(KeyType key_type)
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:337
void set_subject(const std::vector< uint8_t > &subject)
Definition p11_object.h:304
void set_wrap_template(const AttributeContainer &)
Definition p11_object.h:331
void set_check_value(const std::vector< uint8_t > &checksum)
Definition p11_object.h:436
void set_unwrap_template(const AttributeContainer &)
Definition p11_object.h:459
void set_wrap_template(const AttributeContainer &)
Definition p11_object.h:447
BOTAN_FUTURE_EXPLICIT SecretKeyProperties(KeyType key_type)
void set_wrap_with_trusted(bool value)
Definition p11_object.h:421
void set_always_authenticate(bool value)
Definition p11_object.h:424
Represents a PKCS#11 session.
Definition p11_types.h:125
void set_label(std::string_view label)
Definition p11_object.h:173
BOTAN_FUTURE_EXPLICIT StorageObjectProperties(ObjectClass object_class)
AttributeType
Definition p11.h:50
CertificateType
Definition p11.h:213
CK_OBJECT_HANDLE ObjectHandle
Definition p11.h:1214
CK_ATTRIBUTE Attribute
Definition p11.h:1213
CK_DATE Date
Definition p11.h:1219
CK_ULONG Ulong
Definition p11.h:1204
CertificateCategory
Definition p11.h:222
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:128
#define CK_INVALID_HANDLE
Definition pkcs11.h:35
CK_ULONG CK_CERTIFICATE_CATEGORY
Definition pkcs11.h:45