Botan 3.4.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 <functional>
17#include <list>
18#include <string>
19#include <type_traits>
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
32 AttributeContainer(ObjectClass object_class);
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 <typename T>
96 requires std::is_integral<T>::value
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
154 ObjectProperties(ObjectClass object_class);
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
182 void set_modifiable(bool value) { add_bool(AttributeType::Modifiable, value); }
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
188 void set_destroyable(bool value) { add_bool(AttributeType::Destroyable, value); }
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) {
201 add_binary(AttributeType::ObjectId, object_id);
202 }
203
204 /// @param value value of the object
205 inline void set_value(const secure_vector<uint8_t>& value) { add_binary(AttributeType::Value, value); }
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`
218 inline void set_category(CertificateCategory category) {
219 add_numeric(AttributeType::CertificateCategory, static_cast<CK_CERTIFICATE_CATEGORY>(category));
220 }
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) {
227 add_binary(AttributeType::CheckValue, 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) {
242 add_binary(AttributeType::PublicKeyInfo, 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 */
259 KeyProperties(ObjectClass object_class, KeyType key_type);
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 */
281 inline void set_allowed_mechanisms(const std::vector<MechanismType>&) {
282 throw Not_Implemented("KeyProperties::set_allowed_mechanisms");
283 }
284
285 /// @return the key type of this key object
286 inline KeyType key_type() const { return m_key_type; }
287
288 private:
289 const KeyType m_key_type;
290};
291
292/// Common attributes of all public key objects
294 public:
295 /// @param key_type type of key
297
298 /// @param subject DER-encoding of the key subject name
299 inline void set_subject(const std::vector<uint8_t>& subject) { add_binary(AttributeType::Subject, subject); }
300
301 /// @param value true if the key supports encryption
302 inline void set_encrypt(bool value) { add_bool(AttributeType::Encrypt, value); }
303
304 /// @param value true if the key supports verification where the signature is an appendix to the data
305 inline void set_verify(bool value) { add_bool(AttributeType::Verify, value); }
306
307 /// @param value true if the key supports verification where the data is recovered from the signature
308 inline void set_verify_recover(bool value) { add_bool(AttributeType::VerifyRecover, value); }
309
310 /// @param value true if the key supports wrapping (i.e., can be used to wrap other keys)
311 inline void set_wrap(bool value) { add_bool(AttributeType::Wrap, value); }
312
313 /**
314 * @param value true if the key can be trusted for the application that it was created.
315 * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`
316 */
317 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
318
319 /**
320 * For wrapping keys
321 * The attribute template to match against any keys wrapped using this wrapping key.
322 * Keys that do not match cannot be wrapped
323 * Not implemented
324 */
326 throw Not_Implemented("PublicKeyProperties::set_wrap_template");
327 }
328
329 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for this public key
330 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
331 add_binary(AttributeType::PublicKeyInfo, pubkey_info);
332 }
333};
334
335/// Common attributes of all private keys
337 public:
338 /// @param key_type type of key
340
341 /// @param subject DER-encoding of the key subject name
342 inline void set_subject(const std::vector<uint8_t>& subject) { add_binary(AttributeType::Subject, subject); }
343
344 /// @param value true if the key is sensitive
345 inline void set_sensitive(bool value) { add_bool(AttributeType::Sensitive, value); }
346
347 /// @param value true if the key supports decryption
348 inline void set_decrypt(bool value) { add_bool(AttributeType::Decrypt, value); }
349
350 /// @param value true if the key supports signatures where the signature is an appendix to the data
351 inline void set_sign(bool value) { add_bool(AttributeType::Sign, value); }
352
353 /// @param value true if the key supports signatures where the data can be recovered from the signature
354 inline void set_sign_recover(bool value) { add_bool(AttributeType::SignRecover, value); }
355
356 /// @param value true if the key supports unwrapping (i.e., can be used to unwrap other keys)
357 inline void set_unwrap(bool value) { add_bool(AttributeType::Unwrap, value); }
358
359 /// @param value true if the key is extractable and can be wrapped
360 inline void set_extractable(bool value) { add_bool(AttributeType::Extractable, value); }
361
362 /// @param value true if the key can only be wrapped with a wrapping key that has `CKA_TRUSTED` set to `CK_TRUE`
363 inline void set_wrap_with_trusted(bool value) { add_bool(AttributeType::WrapWithTrusted, value); }
364
365 /// @param value If true, the user has to supply the PIN for each use (sign or decrypt) with the key
366 inline void set_always_authenticate(bool value) { add_bool(AttributeType::AlwaysAuthenticate, value); }
367
368 /**
369 * For wrapping keys
370 * The attribute template to apply to any keys unwrapped using this wrapping key.
371 * Any user supplied template is applied after this template as if the object has already been created
372 * Not implemented
373 */
375 throw Not_Implemented("PrivateKeyProperties::set_unwrap_template");
376 }
377
378 /// @param pubkey_info DER-encoding of the SubjectPublicKeyInfo for this public key
379 inline void set_public_key_info(const std::vector<uint8_t>& pubkey_info) {
380 add_binary(AttributeType::PublicKeyInfo, pubkey_info);
381 }
382};
383
384/// Common attributes of all secret (symmetric) keys
386 public:
387 /// @param key_type type of key
389
390 /// @param value true if the key is sensitive
391 inline void set_sensitive(bool value) { add_bool(AttributeType::Sensitive, value); }
392
393 /// @param value true if the key supports encryption
394 inline void set_encrypt(bool value) { add_bool(AttributeType::Encrypt, value); }
395
396 /// @param value true if the key supports decryption
397 inline void set_decrypt(bool value) { add_bool(AttributeType::Decrypt, value); }
398
399 /// @param value true if the key supports signatures where the signature is an appendix to the data
400 inline void set_sign(bool value) { add_bool(AttributeType::Sign, value); }
401
402 /// @param value true if the key supports verification where the signature is an appendix to the data
403 inline void set_verify(bool value) { add_bool(AttributeType::Verify, value); }
404
405 /// @param value true if the key supports unwrapping (i.e., can be used to unwrap other keys)
406 inline void set_unwrap(bool value) { add_bool(AttributeType::Unwrap, value); }
407
408 /// @param value true if the key is extractable and can be wrapped
409 inline void set_extractable(bool value) { add_bool(AttributeType::Extractable, value); }
410
411 /// @param value true if the key can only be wrapped with a wrapping key that has `CKA_TRUSTED` set to `CK_TRUE`
412 inline void set_wrap_with_trusted(bool value) { add_bool(AttributeType::WrapWithTrusted, value); }
413
414 /// @param value if true, the user has to supply the PIN for each use (sign or decrypt) with the key
415 inline void set_always_authenticate(bool value) { add_bool(AttributeType::AlwaysAuthenticate, value); }
416
417 /// @param value true if the key supports wrapping (i.e., can be used to wrap other keys)
418 inline void set_wrap(bool value) { add_bool(AttributeType::Wrap, value); }
419
420 /**
421 * @param value the key can be trusted for the application that it was created.
422 * The wrapping key can be used to wrap keys with `CKA_WRAP_WITH_TRUSTED` set to `CK_TRUE`
423 */
424 inline void set_trusted(bool value) { add_bool(AttributeType::Trusted, value); }
425
426 /// @param checksum the key check value of this key
427 inline void set_check_value(const std::vector<uint8_t>& checksum) {
428 add_binary(AttributeType::CheckValue, checksum);
429 }
430
431 /**
432 * For wrapping keys
433 * The attribute template to match against any keys wrapped using this wrapping key.
434 * Keys that do not match cannot be wrapped
435 * Not implemented
436 */
438 throw Not_Implemented("SecretKeyProperties::set_wrap_template");
439 }
440
441 /**
442 * For wrapping keys
443 * The attribute template to apply to any keys unwrapped using this wrapping key
444 * Any user supplied template is applied after this template as if the object has already been created
445 * Not Implemented
446 */
448 throw Not_Implemented("SecretKeyProperties::set_unwrap_template");
449 }
450};
451
452/// Common attributes of domain parameter
454 public:
455 /// @param key_type type of key the domain parameters can be used to generate
457
458 /// @return the key type
459 inline KeyType key_type() const { return m_key_type; }
460
461 private:
462 const KeyType m_key_type;
463};
464
465/**
466* Represents a PKCS#11 object.
467*/
469 public:
470 /**
471 * Creates an `Object` from an existing PKCS#11 object
472 * @param session the session the object belongs to
473 * @param handle handle of the object
474 */
475
476 Object(Session& session, ObjectHandle handle);
477
478 /**
479 * Creates the object
480 * @param session the session in which the object should be created
481 * @param obj_props properties of this object
482 */
483 Object(Session& session, const ObjectProperties& obj_props);
484
485 Object(const Object&) = default;
486 Object& operator=(const Object&) = delete;
487 virtual ~Object() = default;
488
489 /// Searches for all objects of the given type that match `search_template`
490 template <typename T>
491 static std::vector<T> search(Session& session, const std::vector<Attribute>& search_template);
492
493 /// Searches for all objects of the given type using the label (`CKA_LABEL`)
494 template <typename T>
495 static std::vector<T> search(Session& session, std::string_view label);
496
497 /// Searches for all objects of the given type using the id (`CKA_ID`)
498 template <typename T>
499 static std::vector<T> search(Session& session, const std::vector<uint8_t>& id);
500
501 /// Searches for all objects of the given type using the label (`CKA_LABEL`) and id (`CKA_ID`)
502 template <typename T>
503 static std::vector<T> search(Session& session, std::string_view label, const std::vector<uint8_t>& id);
504
505 /// Searches for all objects of the given type
506 template <typename T>
507 static std::vector<T> search(Session& session);
508
509 /// @returns the value of the given attribute (using `C_GetAttributeValue`)
510 secure_vector<uint8_t> get_attribute_value(AttributeType attribute) const;
511
512 /// Sets the given value for the attribute (using `C_SetAttributeValue`)
513 void set_attribute_value(AttributeType attribute, const secure_vector<uint8_t>& value) const;
514
515 /// Destroys the object
516 void destroy() const;
517
518 /**
519 * Copies the object
520 * @param modified_attributes the attributes of the copied object
521 */
522 ObjectHandle copy(const AttributeContainer& modified_attributes) const;
523
524 /// @return the handle of this object.
525 inline ObjectHandle handle() const { return m_handle; }
526
527 /// @return the session this objects belongs to
528 inline Session& session() const { return m_session; }
529
530 /// @return the module this object belongs to
531 inline Module& module() const { return m_session.get().module(); }
532
533 protected:
534 Object(Session& session) : m_session(session) {}
535
537 if(m_handle != CK_INVALID_HANDLE) {
538 throw Invalid_Argument("Cannot reset handle on already valid PKCS11 object");
539 }
540 m_handle = handle;
541 }
542
543 private:
544 const std::reference_wrapper<Session> m_session;
546};
547
548template <typename T>
549std::vector<T> Object::search(Session& session, const std::vector<Attribute>& search_template) {
550 ObjectFinder finder(session, search_template);
551 std::vector<ObjectHandle> handles = finder.find();
552 std::vector<T> result;
553 result.reserve(handles.size());
554 for(const auto& handle : handles) {
555 result.emplace_back(T(session, handle));
556 }
557 return result;
558}
559
560template <typename T>
561std::vector<T> Object::search(Session& session, std::string_view label) {
562 AttributeContainer search_template(T::Class);
563 search_template.add_string(AttributeType::Label, label);
564 return search<T>(session, search_template.attributes());
565}
566
567template <typename T>
568std::vector<T> Object::search(Session& session, const std::vector<uint8_t>& id) {
569 AttributeContainer search_template(T::Class);
570 search_template.add_binary(AttributeType::Id, id);
571 return search<T>(session, search_template.attributes());
572}
573
574template <typename T>
575std::vector<T> Object::search(Session& session, std::string_view label, const std::vector<uint8_t>& id) {
576 AttributeContainer search_template(T::Class);
577 search_template.add_string(AttributeType::Label, label);
578 search_template.add_binary(AttributeType::Id, id);
579 return search<T>(session, search_template.attributes());
580}
581
582template <typename T>
583std::vector<T> Object::search(Session& session) {
584 return search<T>(session, AttributeContainer(T::Class).attributes());
585}
586
587} // namespace Botan::PKCS11
588
589#endif
Helper class to build the Attribute / CK_ATTRIBUTE structures.
Definition p11_object.h:27
void add_numeric(AttributeType attribute, T value)
Definition p11_object.h:97
AttributeContainer & operator=(const AttributeContainer &other)=delete
AttributeContainer & operator=(AttributeContainer &&other)=default
virtual ~AttributeContainer()=default
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
Common attributes of all certificate objects.
Definition p11_object.h:209
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:241
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
Common attributes of all data objects.
Definition p11_object.h:192
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
Common attributes of domain parameter.
Definition p11_object.h:453
Common attributes of all key objects.
Definition p11_object.h:253
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:281
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
ObjectFinder & operator=(const ObjectFinder &other)=delete
ObjectFinder(ObjectFinder &&other)=default
Common attributes of all objects.
Definition p11_object.h:151
ObjectClass object_class() const
Definition p11_object.h:157
void reset_handle(ObjectHandle handle)
Definition p11_object.h:536
Module & module() const
Definition p11_object.h:531
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:549
Object & operator=(const Object &)=delete
ObjectHandle handle() const
Definition p11_object.h:525
virtual ~Object()=default
Session & session() const
Definition p11_object.h:528
Object(const Object &)=default
Object(Session &session)
Definition p11_object.h:534
Common attributes of all private keys.
Definition p11_object.h:336
void set_subject(const std::vector< uint8_t > &subject)
Definition p11_object.h:342
void set_always_authenticate(bool value)
Definition p11_object.h:366
void set_unwrap_template(const AttributeContainer &)
Definition p11_object.h:374
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:379
Common attributes of all public key objects.
Definition p11_object.h:293
void set_public_key_info(const std::vector< uint8_t > &pubkey_info)
Definition p11_object.h:330
void set_subject(const std::vector< uint8_t > &subject)
Definition p11_object.h:299
void set_wrap_template(const AttributeContainer &)
Definition p11_object.h:325
Common attributes of all secret (symmetric) keys.
Definition p11_object.h:385
void set_check_value(const std::vector< uint8_t > &checksum)
Definition p11_object.h:427
void set_unwrap_template(const AttributeContainer &)
Definition p11_object.h:447
void set_wrap_template(const AttributeContainer &)
Definition p11_object.h:437
void set_wrap_with_trusted(bool value)
Definition p11_object.h:412
void set_always_authenticate(bool value)
Definition p11_object.h:415
Represents a PKCS#11 session.
Definition p11_types.h:121
Common attributes of all storage objects.
Definition p11_object.h:164
void set_label(std::string_view label)
Definition p11_object.h:170
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31
FE_25519 T
Definition ge.cpp:34
AttributeType
Definition p11.h:61
CertificateType
Definition p11.h:172
CK_OBJECT_HANDLE ObjectHandle
Definition p11.h:824
CK_ULONG Ulong
Definition p11.h:814
CertificateCategory
Definition p11.h:181
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61
#define CK_INVALID_HANDLE
Definition pkcs11t.h:75
CK_ULONG CK_CERTIFICATE_CATEGORY
Definition pkcs11t.h:1923