Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

p11.cpp
Go to the documentation of this file.
1 /*
2 * PKCS#11
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 #include <botan/p11.h>
10 #include <botan/p11_session.h>
11
12 #include <cstdint>
13 #include <string>
14 #include <functional>
15
16 namespace Botan {
17 namespace PKCS11 {
18
19 ReturnValue* ThrowException = reinterpret_cast< ReturnValue* >(-1);
20
21 namespace {
22 /// @param function_result Return value of the PKCS11 module function
23 /// @param returnValue if (`ThrowException`) is passed the function throws an exception, otherwise if a non-NULL pointer is passed:
24 /// return_value receives the return value of the PKCS#11 function and no exception is thrown.
25 /// @return true if function call was successful, false otherwise
26 bool handle_return_value(const CK_RV function_result, ReturnValue* return_value)
27 {
28 if(return_value == ThrowException)
29 {
30 if(static_cast< ReturnValue >(function_result) != ReturnValue::OK)
31 {
32 // caller wants exception
33 throw PKCS11_ReturnError(static_cast< ReturnValue >(function_result));
34 }
35 }
36 else if(return_value != nullptr)
37 {
38 // caller wants return value
39 *return_value = static_cast< ReturnValue >(function_result);
40 }
41
42 return static_cast< ReturnValue >(function_result) == ReturnValue::OK;
43 }
44 }
45
46 void initialize_token(Slot& slot, const std::string& label, const secure_string& so_pin, const secure_string& pin)
47 {
48 slot.initialize(label, so_pin);
49 set_pin(slot, so_pin, pin);
50 }
51
52 void change_pin(Slot& slot, const secure_string& old_pin, const secure_string& new_pin)
53 {
54 Session session(slot, false);
55 session.login(UserType::User, old_pin);
56 session.set_pin(old_pin, new_pin);
57 }
58
59 void change_so_pin(Slot& slot, const secure_string& old_so_pin, const secure_string& new_so_pin)
60 {
61 Session session(slot, false);
62 session.login(UserType::SO, old_so_pin);
63 session.set_pin(old_so_pin, new_so_pin);
64 }
65
66 void set_pin(Slot& slot, const secure_string& so_pin, const secure_string& pin)
67 {
68 Session session(slot, false);
69 session.login(UserType::SO, so_pin);
70 session.init_pin(pin);
71 }
72
73 LowLevel::LowLevel(FunctionListPtr ptr) :
74 m_func_list_ptr(ptr)
75 {
76 if(m_func_list_ptr == nullptr)
77 {
78 throw Invalid_Argument("Invalid PKCS#11 function list ptr");
79 }
80 }
81
82 /****************************** General purpose functions ******************************/
83
84 bool LowLevel::C_Initialize(VoidPtr init_args,
85 ReturnValue* return_value) const
86 {
87 return handle_return_value(m_func_list_ptr->C_Initialize(init_args), return_value);
88 }
89
90 bool LowLevel::C_Finalize(VoidPtr reserved,
91 ReturnValue* return_value) const
92 {
93 return handle_return_value(m_func_list_ptr->C_Finalize(reserved), return_value);
94 }
95
96 bool LowLevel::C_GetInfo(Info* info_ptr,
97 ReturnValue* return_value) const
98 {
99 return handle_return_value(m_func_list_ptr->C_GetInfo(info_ptr), return_value);
100 }
101
102 bool LowLevel::C_GetFunctionList(Dynamically_Loaded_Library& pkcs11_module, FunctionListPtr* function_list_ptr_ptr,
103 ReturnValue* return_value)
104 {
105 using get_function_list = CK_RV(*)(FunctionListPtr*);
106
107 get_function_list get_function_list_ptr = pkcs11_module.resolve<get_function_list>("C_GetFunctionList");
108
109 return handle_return_value(get_function_list_ptr(function_list_ptr_ptr), return_value);
110 }
111
112 /****************************** Slot and token management functions ******************************/
113
114 bool LowLevel::C_GetSlotList(Bbool token_present,
115 SlotId* slot_list_ptr,
116 Ulong* count_ptr,
117 ReturnValue* return_value) const
118 {
119 return handle_return_value(m_func_list_ptr->C_GetSlotList(token_present, slot_list_ptr, count_ptr), return_value);
120 }
121
122 bool LowLevel::C_GetSlotList(bool token_present,
123 std::vector<SlotId>& slot_ids,
124 ReturnValue* return_value) const
125 {
126 slot_ids.clear();
127
128 // first get available slots
129 Ulong number_slots = 0;
130
131 bool success = C_GetSlotList(token_present, nullptr, &number_slots, return_value);
132
133 if(!success || !number_slots)
134 {
135 return success;
136 }
137
138 // get actual slot ids
139 slot_ids.resize(number_slots);
140 return C_GetSlotList(token_present, slot_ids.data(), &number_slots, return_value);
141 }
142
143 bool LowLevel::C_GetSlotInfo(SlotId slot_id,
144 SlotInfo* info_ptr,
145 ReturnValue* return_value) const
146 {
147 return handle_return_value(m_func_list_ptr->C_GetSlotInfo(slot_id, info_ptr), return_value);
148 }
149
150 bool LowLevel::C_GetTokenInfo(SlotId slot_id,
151 TokenInfo* info_ptr,
152 ReturnValue* return_value) const
153 {
154 return handle_return_value(m_func_list_ptr->C_GetTokenInfo(slot_id, info_ptr), return_value);
155 }
156
157 bool LowLevel::C_WaitForSlotEvent(Flags flags,
158 SlotId* slot_ptr,
159 VoidPtr reserved,
160 ReturnValue* return_value) const
161 {
162 return handle_return_value(m_func_list_ptr->C_WaitForSlotEvent(flags, slot_ptr, reserved), return_value);
163 }
164
165 bool LowLevel::C_GetMechanismList(SlotId slot_id,
166 MechanismType* mechanism_list_ptr,
167 Ulong* count_ptr,
168 ReturnValue* return_value) const
169 {
170 return handle_return_value(m_func_list_ptr->C_GetMechanismList(slot_id,
171 reinterpret_cast< CK_MECHANISM_TYPE_PTR >(mechanism_list_ptr), count_ptr), return_value);
172 }
173
174 bool LowLevel::C_GetMechanismList(SlotId slot_id,
175 std::vector<MechanismType>& mechanisms,
176 ReturnValue* return_value) const
177 {
178 mechanisms.clear();
179
180 // first get number of mechanisms
181 Ulong number_mechanisms = 0;
182
183 bool success = C_GetMechanismList(slot_id, nullptr, &number_mechanisms, return_value);
184
185 if(!success || !number_mechanisms)
186 {
187 return success;
188 }
189
190 // get actual mechanisms
191 mechanisms.resize(number_mechanisms);
192 return C_GetMechanismList(slot_id, reinterpret_cast< MechanismType* >(mechanisms.data()), &number_mechanisms,
193 return_value);
194 }
195
196 bool LowLevel::C_GetMechanismInfo(SlotId slot_id,
197 MechanismType type,
198 MechanismInfo* info_ptr,
199 ReturnValue* return_value) const
200 {
201 return handle_return_value(m_func_list_ptr->C_GetMechanismInfo(slot_id, static_cast< CK_MECHANISM_TYPE >(type),
202 info_ptr), return_value);
203 }
204
205 bool LowLevel::C_InitToken(SlotId slot_id,
206 Utf8Char* so_pin_ptr,
207 Ulong so_pin_len,
208 Utf8Char* label_ptr,
209 ReturnValue* return_value) const
210 {
211 return handle_return_value(m_func_list_ptr->C_InitToken(slot_id, so_pin_ptr, so_pin_len, label_ptr), return_value);
212 }
213
214 bool LowLevel::C_InitPIN(SessionHandle session,
215 Utf8Char* pin_ptr,
216 Ulong pin_len,
217 ReturnValue* return_value) const
218 {
219 return handle_return_value(m_func_list_ptr->C_InitPIN(session, pin_ptr, pin_len), return_value);
220 }
221
222 bool LowLevel::C_SetPIN(SessionHandle session,
223 Utf8Char* old_pin_ptr,
224 Ulong old_len,
225 Utf8Char* new_pin_ptr,
226 Ulong new_len,
227 ReturnValue* return_value) const
228 {
229 return handle_return_value(m_func_list_ptr->C_SetPIN(session, old_pin_ptr, old_len, new_pin_ptr, new_len),
230 return_value);
231 }
232
233 /****************************** Session management ******************************/
234
235 bool LowLevel::C_OpenSession(SlotId slot_id,
236 Flags flags,
237 VoidPtr application,
238 Notify notify,
239 SessionHandle* session_ptr,
240 ReturnValue* return_value) const
241 {
242 return handle_return_value(m_func_list_ptr->C_OpenSession(slot_id, flags, application, notify, session_ptr),
243 return_value);
244 }
245
246 bool LowLevel::C_CloseSession(SessionHandle session,
247 ReturnValue* return_value) const
248 {
249 return handle_return_value(m_func_list_ptr->C_CloseSession(session), return_value);
250 }
251
252 bool LowLevel::C_CloseAllSessions(SlotId slot_id,
253 ReturnValue* return_value) const
254 {
255 return handle_return_value(m_func_list_ptr->C_CloseAllSessions(slot_id), return_value);
256 }
257
258 bool LowLevel::C_GetSessionInfo(SessionHandle session,
259 SessionInfo* info_ptr,
260 ReturnValue* return_value) const
261 {
262 return handle_return_value(m_func_list_ptr->C_GetSessionInfo(session, info_ptr), return_value);
263 }
264
265 bool LowLevel::C_GetOperationState(SessionHandle session,
266 Byte* operation_state_ptr,
267 Ulong* operation_state_len_ptr,
268 ReturnValue* return_value) const
269 {
270 return handle_return_value(m_func_list_ptr->C_GetOperationState(session, operation_state_ptr, operation_state_len_ptr),
271 return_value);
272 }
273
274 bool LowLevel::C_SetOperationState(SessionHandle session,
275 Byte* operation_state_ptr,
276 Ulong operation_state_len,
277 ObjectHandle encryption_key,
278 ObjectHandle authentication_key,
279 ReturnValue* return_value) const
280 {
281 return handle_return_value(m_func_list_ptr->C_SetOperationState(session, operation_state_ptr, operation_state_len,
282 encryption_key, authentication_key), return_value);
283 }
284
285 bool LowLevel::C_Login(SessionHandle session,
286 UserType user_type,
287 Utf8Char* pin_ptr,
288 Ulong pin_len,
289 ReturnValue* return_value) const
290 {
291 return handle_return_value(m_func_list_ptr->C_Login(session, static_cast< CK_USER_TYPE >(user_type), pin_ptr, pin_len),
292 return_value);
293 }
294
295 bool LowLevel::C_Logout(SessionHandle session,
296 ReturnValue* return_value) const
297 {
298 return handle_return_value(m_func_list_ptr->C_Logout(session), return_value);
299 }
300
301 /****************************** Object management functions ******************************/
302
303 bool LowLevel::C_CreateObject(SessionHandle session,
304 Attribute* attribute_template_ptr,
305 Ulong count,
306 ObjectHandle* object_ptr,
307 ReturnValue* return_value) const
308 {
309 return handle_return_value(m_func_list_ptr->C_CreateObject(session, attribute_template_ptr, count, object_ptr),
310 return_value);
311 }
312
313 bool LowLevel::C_CopyObject(SessionHandle session,
314 ObjectHandle object,
315 Attribute* attribute_template_ptr,
316 Ulong count,
317 ObjectHandle* new_object_ptr,
318 ReturnValue* return_value) const
319 {
320 return handle_return_value(m_func_list_ptr->C_CopyObject(session, object, attribute_template_ptr, count,
321 new_object_ptr), return_value);
322 }
323
324 bool LowLevel::C_DestroyObject(SessionHandle session,
325 ObjectHandle object,
326 ReturnValue* return_value) const
327 {
328 return handle_return_value(m_func_list_ptr->C_DestroyObject(session, object), return_value);
329 }
330
331 bool LowLevel::C_GetObjectSize(SessionHandle session,
332 ObjectHandle object,
333 Ulong* size_ptr,
334 ReturnValue* return_value) const
335 {
336 return handle_return_value(m_func_list_ptr->C_GetObjectSize(session, object, size_ptr), return_value);
337 }
338
339 bool LowLevel::C_GetAttributeValue(SessionHandle session,
340 ObjectHandle object,
341 Attribute* attribute_template_ptr,
342 Ulong count,
343 ReturnValue* return_value) const
344 {
345 return handle_return_value(m_func_list_ptr->C_GetAttributeValue(session, object, attribute_template_ptr, count),
346 return_value);
347 }
348
349 bool LowLevel::C_SetAttributeValue(SessionHandle session,
350 ObjectHandle object,
351 Attribute* attribute_template_ptr,
352 Ulong count,
353 ReturnValue* return_value) const
354 {
355 return handle_return_value(m_func_list_ptr->C_SetAttributeValue(session, object, attribute_template_ptr, count),
356 return_value);
357 }
358
359 bool LowLevel::C_FindObjectsInit(SessionHandle session,
360 Attribute* attribute_template_ptr,
361 Ulong count,
362 ReturnValue* return_value) const
363 {
364 return handle_return_value(m_func_list_ptr->C_FindObjectsInit(session, attribute_template_ptr, count), return_value);
365 }
366
367 bool LowLevel::C_FindObjects(SessionHandle session,
368 ObjectHandle* object_ptr,
369 Ulong max_object_count,
370 Ulong* object_count_ptr,
371 ReturnValue* return_value) const
372 {
373 return handle_return_value(m_func_list_ptr->C_FindObjects(session, object_ptr, max_object_count, object_count_ptr),
374 return_value);
375 }
376
377 bool LowLevel::C_FindObjectsFinal(SessionHandle session,
378 ReturnValue* return_value) const
379 {
380 return handle_return_value(m_func_list_ptr->C_FindObjectsFinal(session), return_value);
381 }
382
383 /****************************** Encryption functions ******************************/
384
385 bool LowLevel::C_EncryptInit(SessionHandle session,
386 Mechanism* mechanism_ptr,
387 ObjectHandle key,
388 ReturnValue* return_value) const
389 {
390 return handle_return_value(m_func_list_ptr->C_EncryptInit(session, mechanism_ptr, key), return_value);
391 }
392
393 bool LowLevel::C_Encrypt(SessionHandle session,
394 Byte* data_ptr,
395 Ulong data_len,
396 Byte* encrypted_data_ptr,
397 Ulong* encrypted_data_len_ptr,
398 ReturnValue* return_value) const
399 {
400 return handle_return_value(m_func_list_ptr->C_Encrypt(session, data_ptr, data_len, encrypted_data_ptr,
401 encrypted_data_len_ptr), return_value);
402 }
403
404 bool LowLevel::C_EncryptUpdate(SessionHandle session,
405 Byte* part_ptr,
406 Ulong part_len,
407 Byte* encrypted_part_ptr,
408 Ulong* encrypted_part_len_ptr,
409 ReturnValue* return_value) const
410 {
411 return handle_return_value(m_func_list_ptr->C_EncryptUpdate(session, part_ptr, part_len, encrypted_part_ptr,
412 encrypted_part_len_ptr), return_value);
413 }
414
415 bool LowLevel::C_EncryptFinal(SessionHandle session,
416 Byte* last_encrypted_part_ptr,
417 Ulong* last_encrypted_part_len_ptr,
418 ReturnValue* return_value) const
419 {
420 return handle_return_value(m_func_list_ptr->C_EncryptFinal(session, last_encrypted_part_ptr,
421 last_encrypted_part_len_ptr), return_value);
422 }
423
424 /****************************** Decryption functions ******************************/
425
426 bool LowLevel::C_DecryptInit(SessionHandle session,
427 Mechanism* mechanism_ptr,
428 ObjectHandle key,
429 ReturnValue* return_value) const
430 {
431 return handle_return_value(m_func_list_ptr->C_DecryptInit(session, mechanism_ptr, key), return_value);
432 }
433
434 bool LowLevel::C_Decrypt(SessionHandle session,
435 Byte* encrypted_data_ptr,
436 Ulong encrypted_data_len,
437 Byte* data_ptr,
438 Ulong* data_len_ptr,
439 ReturnValue* return_value) const
440 {
441 return handle_return_value(m_func_list_ptr->C_Decrypt(session, encrypted_data_ptr, encrypted_data_len, data_ptr,
442 data_len_ptr), return_value);
443 }
444
445 bool LowLevel::C_DecryptUpdate(SessionHandle session,
446 Byte* encrypted_part_ptr,
447 Ulong encrypted_part_len,
448 Byte* part_ptr,
449 Ulong* part_len_ptr,
450 ReturnValue* return_value) const
451 {
452 return handle_return_value(m_func_list_ptr->C_DecryptUpdate(session, encrypted_part_ptr, encrypted_part_len, part_ptr,
453 part_len_ptr), return_value);
454 }
455
456 bool LowLevel::C_DecryptFinal(SessionHandle session,
457 Byte* last_part_ptr,
458 Ulong* last_part_len_ptr,
459 ReturnValue* return_value) const
460 {
461 return handle_return_value(m_func_list_ptr->C_DecryptFinal(session, last_part_ptr, last_part_len_ptr), return_value);
462 }
463
464 /****************************** Message digesting functions ******************************/
465
466 bool LowLevel::C_DigestInit(SessionHandle session,
467 Mechanism* mechanism,
468 ReturnValue* return_value) const
469 {
470 return handle_return_value(m_func_list_ptr->C_DigestInit(session, mechanism), return_value);
471 }
472
473 bool LowLevel::C_Digest(SessionHandle session,
474 Byte* data_ptr,
475 Ulong data_len,
476 Byte* digest_ptr,
477 Ulong* digest_len_ptr,
478 ReturnValue* return_value) const
479 {
480 return handle_return_value(m_func_list_ptr->C_Digest(session, data_ptr, data_len, digest_ptr, digest_len_ptr),
481 return_value);
482 }
483
484 bool LowLevel::C_DigestUpdate(SessionHandle session,
485 Byte* part_ptr,
486 Ulong part_len,
487 ReturnValue* return_value) const
488 {
489 return handle_return_value(m_func_list_ptr->C_DigestUpdate(session, part_ptr, part_len), return_value);
490 }
491
492 bool LowLevel::C_DigestKey(SessionHandle session,
493 ObjectHandle key,
494 ReturnValue* return_value) const
495 {
496 return handle_return_value(m_func_list_ptr->C_DigestKey(session, key), return_value);
497 }
498
499 bool LowLevel::C_DigestFinal(SessionHandle session,
500 Byte* digest_ptr,
501 Ulong* digest_len_ptr,
502 ReturnValue* return_value) const
503 {
504 return handle_return_value(m_func_list_ptr->C_DigestFinal(session, digest_ptr, digest_len_ptr), return_value);
505 }
506
507 /****************************** Signing and MACing functions ******************************/
508
509 bool LowLevel::C_SignInit(SessionHandle session,
510 Mechanism* mechanism_ptr,
511 ObjectHandle key,
512 ReturnValue* return_value) const
513 {
514 return handle_return_value(m_func_list_ptr->C_SignInit(session, mechanism_ptr, key), return_value);
515 }
516
517 bool LowLevel::C_Sign(SessionHandle session,
518 Byte* data_ptr,
519 Ulong data_len,
520 Byte* signature_ptr,
521 Ulong* signature_len_ptr,
522 ReturnValue* return_value) const
523 {
524 return handle_return_value(m_func_list_ptr->C_Sign(session, data_ptr, data_len, signature_ptr, signature_len_ptr),
525 return_value);
526 }
527
528 bool LowLevel::C_SignUpdate(SessionHandle session,
529 Byte* part_ptr,
530 Ulong part_len,
531 ReturnValue* return_value) const
532 {
533 return handle_return_value(m_func_list_ptr->C_SignUpdate(session, part_ptr, part_len), return_value);
534 }
535
536 bool LowLevel::C_SignFinal(SessionHandle session,
537 Byte* signature_ptr,
538 Ulong* signature_len_ptr,
539 ReturnValue* return_value) const
540 {
541 return handle_return_value(m_func_list_ptr->C_SignFinal(session, signature_ptr, signature_len_ptr), return_value);
542 }
543
544 bool LowLevel::C_SignRecoverInit(SessionHandle session,
545 Mechanism* mechanism_ptr,
546 ObjectHandle key,
547 ReturnValue* return_value) const
548 {
549 return handle_return_value(m_func_list_ptr->C_SignRecoverInit(session, mechanism_ptr, key), return_value);
550 }
551
552 bool LowLevel::C_SignRecover(SessionHandle session,
553 Byte* data,
554 Ulong data_len,
555 Byte* signature,
556 Ulong* signature_len,
557 ReturnValue* return_value) const
558 {
559 return handle_return_value(m_func_list_ptr->C_SignRecover(session, data, data_len, signature, signature_len),
560 return_value);
561 }
562
563 /****************************** Functions for verifying signatures and MACs ******************************/
564
565 bool LowLevel::C_VerifyInit(SessionHandle session,
566 Mechanism* mechanism_ptr,
567 ObjectHandle key,
568 ReturnValue* return_value) const
569 {
570 return handle_return_value(m_func_list_ptr->C_VerifyInit(session, mechanism_ptr, key), return_value);
571 }
572
573 bool LowLevel::C_Verify(SessionHandle session,
574 Byte* data_ptr,
575 Ulong data_len,
576 Byte* signature_ptr,
577 Ulong signature_len,
578 ReturnValue* return_value) const
579 {
580 return handle_return_value(m_func_list_ptr->C_Verify(session, data_ptr, data_len, signature_ptr, signature_len),
581 return_value);
582 }
583
584 bool LowLevel::C_VerifyUpdate(SessionHandle session,
585 Byte* part_ptr,
586 Ulong part_len,
587 ReturnValue* return_value) const
588 {
589 return handle_return_value(m_func_list_ptr->C_VerifyUpdate(session, part_ptr, part_len), return_value);
590 }
591
592 bool LowLevel::C_VerifyFinal(SessionHandle session,
593 Byte* signature_ptr,
594 Ulong signature_len,
595 ReturnValue* return_value) const
596 {
597 return handle_return_value(m_func_list_ptr->C_VerifyFinal(session, signature_ptr, signature_len), return_value);
598 }
599
600 bool LowLevel::C_VerifyRecoverInit(SessionHandle session,
601 Mechanism* mechanism_ptr,
602 ObjectHandle key,
603 ReturnValue* return_value) const
604 {
605 return handle_return_value(m_func_list_ptr->C_VerifyRecoverInit(session, mechanism_ptr, key), return_value);
606 }
607
608 bool LowLevel::C_VerifyRecover(SessionHandle session,
609 Byte* signature_ptr,
610 Ulong signature_len,
611 Byte* data_ptr,
612 Ulong* data_len_ptr,
613 ReturnValue* return_value) const
614 {
615 return handle_return_value(m_func_list_ptr->C_VerifyRecover(session, signature_ptr, signature_len, data_ptr,
616 data_len_ptr), return_value);
617 }
618
619 /****************************** Dual-purpose cryptographic functions ******************************/
620
621 bool LowLevel::C_DigestEncryptUpdate(SessionHandle session,
622 Byte* part_ptr,
623 Ulong part_len,
624 Byte* encrypted_part_ptr,
625 Ulong* encrypted_part_len_ptr,
626 ReturnValue* return_value) const
627 {
628 return handle_return_value(m_func_list_ptr->C_DigestEncryptUpdate(session, part_ptr, part_len, encrypted_part_ptr,
629 encrypted_part_len_ptr), return_value);
630 }
631
632 bool LowLevel::C_DecryptDigestUpdate(SessionHandle session,
633 Byte* encrypted_part_ptr,
634 Ulong encrypted_part_len,
635 Byte* part_ptr,
636 Ulong* part_len_ptr,
637 ReturnValue* return_value) const
638 {
639 return handle_return_value(m_func_list_ptr->C_DecryptDigestUpdate(session, encrypted_part_ptr, encrypted_part_len,
640 part_ptr, part_len_ptr), return_value);
641 }
642
643 bool LowLevel::C_SignEncryptUpdate(SessionHandle session,
644 Byte* part_ptr,
645 Ulong part_len,
646 Byte* encrypted_part_ptr,
647 Ulong* encrypted_part_len_ptr,
648 ReturnValue* return_value) const
649 {
650 return handle_return_value(m_func_list_ptr->C_SignEncryptUpdate(session, part_ptr, part_len, encrypted_part_ptr,
651 encrypted_part_len_ptr), return_value);
652 }
653
654 bool LowLevel::C_DecryptVerifyUpdate(SessionHandle session,
655 Byte* encrypted_part_ptr,
656 Ulong encrypted_part_len,
657 Byte* part_ptr,
658 Ulong* part_len_ptr,
659 ReturnValue* return_value) const
660 {
661 return handle_return_value(m_func_list_ptr->C_DecryptVerifyUpdate(session, encrypted_part_ptr, encrypted_part_len,
662 part_ptr, part_len_ptr), return_value);
663 }
664
665 /****************************** Key management functions ******************************/
666
667 bool LowLevel::C_GenerateKey(SessionHandle session,
668 Mechanism* mechanism_ptr,
669 Attribute* attribute_template_ptr,
670 Ulong count,
671 ObjectHandle* key_ptr,
672 ReturnValue* return_value) const
673 {
674 return handle_return_value(m_func_list_ptr->C_GenerateKey(session, mechanism_ptr, attribute_template_ptr, count,
675 key_ptr), return_value);
676 }
677
678 bool LowLevel::C_GenerateKeyPair(SessionHandle session,
679 Mechanism* mechanism_ptr,
680 Attribute* public_key_template_ptr,
681 Ulong public_key_attribute_count,
682 Attribute* private_key_template_ptr,
683 Ulong private_key_attribute_count,
684 ObjectHandle* public_key_ptr,
685 ObjectHandle* private_key_ptr,
686 ReturnValue* return_value) const
687 {
688 return handle_return_value(m_func_list_ptr->C_GenerateKeyPair(session, mechanism_ptr, public_key_template_ptr,
689 public_key_attribute_count, private_key_template_ptr,
690 private_key_attribute_count, public_key_ptr, private_key_ptr), return_value);
691 }
692
693 bool LowLevel::C_WrapKey(SessionHandle session,
694 Mechanism* mechanism_ptr,
695 ObjectHandle wrapping_key,
696 ObjectHandle key,
697 Byte* wrapped_key_ptr,
698 Ulong* wrapped_key_len_ptr,
699 ReturnValue* return_value) const
700 {
701 return handle_return_value(m_func_list_ptr->C_WrapKey(session, mechanism_ptr, wrapping_key, key, wrapped_key_ptr,
702 wrapped_key_len_ptr), return_value);
703 }
704
705 bool LowLevel::C_UnwrapKey(SessionHandle session,
706 Mechanism* mechanism_ptr,
707 ObjectHandle unwrapping_key,
708 Byte* wrapped_key_ptr,
709 Ulong wrapped_key_len,
710 Attribute* attribute_template_ptr,
711 Ulong attribute_count,
712 ObjectHandle* key_ptr,
713 ReturnValue* return_value) const
714 {
715 return handle_return_value(m_func_list_ptr->C_UnwrapKey(session, mechanism_ptr, unwrapping_key, wrapped_key_ptr,
716 wrapped_key_len, attribute_template_ptr,
717 attribute_count, key_ptr), return_value);
718 }
719
720 bool LowLevel::C_DeriveKey(SessionHandle session,
721 Mechanism* mechanism_ptr,
722 ObjectHandle base_key,
723 Attribute* attribute_template_ptr,
724 Ulong attribute_count,
725 ObjectHandle* key_ptr,
726 ReturnValue* return_value) const
727 {
728 return handle_return_value(m_func_list_ptr->C_DeriveKey(session, mechanism_ptr, base_key, attribute_template_ptr,
729 attribute_count, key_ptr), return_value);
730 }
731
732 /****************************** Random number generation functions ******************************/
733
734 bool LowLevel::C_SeedRandom(SessionHandle session,
735 Byte* seed_ptr,
736 Ulong seed_len,
737 ReturnValue* return_value) const
738 {
739 return handle_return_value(m_func_list_ptr->C_SeedRandom(session, seed_ptr, seed_len), return_value);
740 }
741
742 bool LowLevel::C_GenerateRandom(SessionHandle session,
743 Byte* random_data_ptr,
744 Ulong random_len,
745 ReturnValue* return_value) const
746 {
747 return handle_return_value(m_func_list_ptr->C_GenerateRandom(session, random_data_ptr, random_len), return_value);
748 }
749
750 /****************************** Parallel function management functions ******************************/
751
752 bool LowLevel::C_GetFunctionStatus(SessionHandle session,
753 ReturnValue* return_value) const
754 {
755 return handle_return_value(m_func_list_ptr->C_GetFunctionStatus(session), return_value);
756 }
757
758 bool LowLevel::C_CancelFunction(SessionHandle session,
759 ReturnValue* return_value) const
760 {
761 return handle_return_value(m_func_list_ptr->C_CancelFunction(session), return_value);
762 }
763
764 }
765
766 }
Botan::PKCS11::Slot::initialize
void initialize(const std::string &label, const secure_string &so_pin) const
Definition: p11_slot.cpp:54
Botan::PKCS11::Utf8Char
CK_UTF8CHAR Utf8Char
Definition: p11.h:841
Botan::PKCS11::Notify
CK_NOTIFY Notify
Definition: p11.h:842
Botan::PKCS11::LowLevel::C_GetMechanismList
bool C_GetMechanismList(SlotId slot_id, MechanismType *mechanism_list_ptr, Ulong *count_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:165
Botan::Invalid_Argument
Definition: exceptn.h:34
CK_TOKEN_INFO
Definition: pkcs11t.h:130
Botan::PKCS11::ReturnValue
ReturnValue
Definition: p11.h:713
Botan::PKCS11::ThrowException
ReturnValue * ThrowException
Definition: p11.cpp:19
CK_SLOT_INFO
Definition: pkcs11t.h:110
Botan::PKCS11::LowLevel::C_EncryptUpdate
bool C_EncryptUpdate(SessionHandle session, Byte *part_ptr, Ulong part_len, Byte *encrypted_part_ptr, Ulong *encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:404
Botan::PKCS11::Session::init_pin
void init_pin(const secure_string &new_pin)
Calls C_InitPIN to change or initialize the PIN using the SO_PIN (requires a logged in session) ...
Definition: p11_session.cpp:90
Botan::PKCS11::LowLevel::C_DecryptVerifyUpdate
bool C_DecryptVerifyUpdate(SessionHandle session, Byte *encrypted_part_ptr, Ulong encrypted_part_len, Byte *part_ptr, Ulong *part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:654
Botan::PKCS11::LowLevel::C_GetTokenInfo
bool C_GetTokenInfo(SlotId slot_id, TokenInfo *info_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:150
CK_SESSION_INFO
Definition: pkcs11t.h:279
Botan::PKCS11::LowLevel::C_WrapKey
bool C_WrapKey(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle wrapping_key, ObjectHandle key, Byte *wrapped_key_ptr, Ulong *wrapped_key_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:693
Botan::PKCS11::LowLevel::C_DeriveKey
bool C_DeriveKey(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle base_key, Attribute *attribute_template_ptr, Ulong attribute_count, ObjectHandle *key_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:720
Botan::PKCS11::LowLevel::C_GenerateKeyPair
bool C_GenerateKeyPair(SessionHandle session, Mechanism *mechanism_ptr, Attribute *public_key_template_ptr, Ulong public_key_attribute_count, Attribute *private_key_template_ptr, Ulong private_key_attribute_count, ObjectHandle *public_key_ptr, ObjectHandle *private_key_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:678
Botan::PKCS11::LowLevel::C_VerifyRecover
bool C_VerifyRecover(SessionHandle session, Byte *signature_ptr, Ulong signature_len, Byte *data_ptr, Ulong *data_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:608
Botan::PKCS11::LowLevel::C_UnwrapKey
bool C_UnwrapKey(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle unwrapping_key, Byte *wrapped_key_ptr, Ulong wrapped_key_len, Attribute *attribute_template_ptr, Ulong attribute_count, ObjectHandle *key_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:705
Botan::PKCS11::LowLevel::C_DecryptFinal
bool C_DecryptFinal(SessionHandle session, Byte *last_part_ptr, Ulong *last_part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:456
Botan::Dynamically_Loaded_Library::resolve
T resolve(const std::string &symbol)
Definition: dyn_load.h:53
Botan::PKCS11::UserType::User
Botan::PKCS11::LowLevel::C_DigestFinal
bool C_DigestFinal(SessionHandle session, Byte *digest_ptr, Ulong *digest_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:499
Botan::PKCS11::LowLevel::C_GetSlotList
bool C_GetSlotList(Bbool token_present, SlotId *slot_list_ptr, Ulong *count_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:114
Botan::PKCS11::change_so_pin
void change_so_pin(Slot &slot, const secure_string &old_so_pin, const secure_string &new_so_pin)
Definition: p11.cpp:59
Botan::PKCS11::LowLevel::C_SetPIN
bool C_SetPIN(SessionHandle session, Utf8Char *old_pin_ptr, Ulong old_len, Utf8Char *new_pin_ptr, Ulong new_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:222
Botan::PKCS11::LowLevel::C_GenerateKey
bool C_GenerateKey(SessionHandle session, Mechanism *mechanism_ptr, Attribute *attribute_template_ptr, Ulong count, ObjectHandle *key_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:667
Botan::PKCS11::LowLevel::C_InitPIN
bool C_InitPIN(SessionHandle session, Utf8Char *pin_ptr, Ulong pin_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:214
Botan::PKCS11::LowLevel::C_Sign
bool C_Sign(SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *signature_ptr, Ulong *signature_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:517
Botan::PKCS11::Session::login
void login(UserType userType, const secure_string &pin)
Definition: p11_session.cpp:66
Botan::PKCS11::LowLevel::C_SetOperationState
bool C_SetOperationState(SessionHandle session, Byte *operation_state_ptr, Ulong operation_state_len, ObjectHandle encryption_key, ObjectHandle authentication_key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:274
Botan::PKCS11::LowLevel::C_GetObjectSize
bool C_GetObjectSize(SessionHandle session, ObjectHandle object, Ulong *size_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:331
Botan::PKCS11::set_pin
void set_pin(Slot &slot, const secure_string &so_pin, const secure_string &pin)
Definition: p11.cpp:66
Botan::PKCS11::LowLevel::C_EncryptInit
bool C_EncryptInit(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:385
Botan::PKCS11::flags
Flags flags(Flag flags)
Definition: p11.h:858
Botan::PKCS11::LowLevel::C_GetSlotInfo
bool C_GetSlotInfo(SlotId slot_id, SlotInfo *info_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:143
Botan::PKCS11::Ulong
CK_ULONG Ulong
Definition: p11.h:836
Botan::PKCS11::LowLevel::C_FindObjectsFinal
bool C_FindObjectsFinal(SessionHandle session, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:377
Botan::PKCS11::LowLevel::C_DigestInit
bool C_DigestInit(SessionHandle session, Mechanism *mechanism_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:466
Botan::PKCS11::VoidPtr
CK_VOID_PTR VoidPtr
Definition: p11.h:826
type
MechanismType type
Definition: p11_mechanism.cpp:43
Botan::PKCS11::Byte
CK_BYTE Byte
Definition: p11.h:847
Botan::PKCS11::Session::set_pin
void set_pin(const secure_string &old_pin, const secure_string &new_pin) const
Calls C_SetPIN to change the PIN using the old PIN (requires a logged in session) ...
Definition: p11_session.cpp:85
Botan::PKCS11::LowLevel::C_SignEncryptUpdate
bool C_SignEncryptUpdate(SessionHandle session, Byte *part_ptr, Ulong part_len, Byte *encrypted_part_ptr, Ulong *encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:643
Botan::PKCS11::LowLevel::C_CancelFunction
bool C_CancelFunction(SessionHandle session, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:758
CK_MECHANISM_INFO
Definition: pkcs11t.h:995
Botan::PKCS11::LowLevel::C_SignRecover
bool C_SignRecover(SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *signature_ptr, Ulong *signature_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:552
Botan::PKCS11::LowLevel::C_GenerateRandom
bool C_GenerateRandom(SessionHandle session, Byte *random_data_ptr, Ulong random_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:742
Botan::PKCS11::LowLevel::C_SignRecoverInit
bool C_SignRecoverInit(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:544
Botan::PKCS11::FunctionListPtr
CK_FUNCTION_LIST_PTR FunctionListPtr
Definition: p11.h:825
Botan::PKCS11::LowLevel::C_VerifyUpdate
bool C_VerifyUpdate(SessionHandle session, Byte *part_ptr, Ulong part_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:584
Botan::PKCS11::SessionHandle
CK_SESSION_HANDLE SessionHandle
Definition: p11.h:843
Botan::PKCS11::LowLevel::C_VerifyFinal
bool C_VerifyFinal(SessionHandle session, Byte *signature_ptr, Ulong signature_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:592
Botan::PKCS11::LowLevel::LowLevel
LowLevel(FunctionListPtr ptr)
Definition: p11.cpp:73
Botan::PKCS11::LowLevel::C_CloseSession
bool C_CloseSession(SessionHandle session, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:246
Botan::PKCS11::LowLevel::C_WaitForSlotEvent
bool C_WaitForSlotEvent(Flags flags, SlotId *slot_ptr, VoidPtr reserved, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:157
Botan::PKCS11::LowLevel::C_GetOperationState
bool C_GetOperationState(SessionHandle session, Byte *operation_state_ptr, Ulong *operation_state_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:265
Botan::PKCS11::LowLevel::C_VerifyRecoverInit
bool C_VerifyRecoverInit(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:600
Botan::PKCS11::LowLevel::C_CreateObject
bool C_CreateObject(SessionHandle session, Attribute *attribute_template_ptr, Ulong count, ObjectHandle *object_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:303
CK_RV
CK_ULONG CK_RV
Definition: pkcs11t.h:1036
Botan::PKCS11::LowLevel::C_DigestUpdate
bool C_DigestUpdate(SessionHandle session, Byte *part_ptr, Ulong part_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:484
Botan::PKCS11::LowLevel::C_Logout
bool C_Logout(SessionHandle session, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:295
Botan::PKCS11::LowLevel::C_VerifyInit
bool C_VerifyInit(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:565
CK_MECHANISM
Definition: pkcs11t.h:983
Botan::PKCS11::LowLevel::C_Finalize
bool C_Finalize(VoidPtr reserved, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:90
Botan::PKCS11::LowLevel::C_GetFunctionStatus
bool C_GetFunctionStatus(SessionHandle session, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:752
Botan::PKCS11::LowLevel::C_DecryptUpdate
bool C_DecryptUpdate(SessionHandle session, Byte *encrypted_part_ptr, Ulong encrypted_part_len, Byte *part_ptr, Ulong *part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:445
Botan::PKCS11::LowLevel::C_Login
bool C_Login(SessionHandle session, UserType user_type, Utf8Char *pin_ptr, Ulong pin_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:285
Botan::PKCS11::LowLevel::C_FindObjectsInit
bool C_FindObjectsInit(SessionHandle session, Attribute *attribute_template_ptr, Ulong count, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:359
Botan::PKCS11::LowLevel::C_GetFunctionList
static bool C_GetFunctionList(Dynamically_Loaded_Library &pkcs11_module, FunctionListPtr *function_list_ptr_ptr, ReturnValue *return_value=ThrowException)
Definition: p11.cpp:102
Botan::PKCS11::initialize_token
void initialize_token(Slot &slot, const std::string &label, const secure_string &so_pin, const secure_string &pin)
Definition: p11.cpp:46
Botan
Definition: alg_id.cpp:13
Botan::PKCS11::ObjectHandle
CK_OBJECT_HANDLE ObjectHandle
Definition: p11.h:846
Botan::Dynamically_Loaded_Library
Definition: dyn_load.h:19
Botan::PKCS11::LowLevel::C_Encrypt
bool C_Encrypt(SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *encrypted_data, Ulong *encrypted_data_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:393
Botan::PKCS11::LowLevel::C_FindObjects
bool C_FindObjects(SessionHandle session, ObjectHandle *object_ptr, Ulong max_object_count, Ulong *object_count_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:367
Botan::PKCS11::change_pin
void change_pin(Slot &slot, const secure_string &old_pin, const secure_string &new_pin)
Definition: p11.cpp:52
Botan::PKCS11::LowLevel::C_GetAttributeValue
bool C_GetAttributeValue(SessionHandle session, ObjectHandle object, Attribute *attribute_template_ptr, Ulong count, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:339
Botan::PKCS11::LowLevel::C_DestroyObject
bool C_DestroyObject(SessionHandle session, ObjectHandle object, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:324
Botan::PKCS11::Flags
CK_FLAGS Flags
Definition: p11.h:832
Botan::PKCS11::ReturnValue::OK
Botan::PKCS11::PKCS11_ReturnError
Definition: p11.h:2833
Botan::PKCS11::SlotId
CK_SLOT_ID SlotId
Definition: p11.h:835
Botan::PKCS11::LowLevel::C_SetAttributeValue
bool C_SetAttributeValue(SessionHandle session, ObjectHandle object, Attribute *attribute_template_ptr, Ulong count, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:349
Botan::PKCS11::LowLevel::C_DigestKey
bool C_DigestKey(SessionHandle session, ObjectHandle key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:492
Botan::PKCS11::LowLevel::C_DecryptInit
bool C_DecryptInit(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:426
Botan::PKCS11::LowLevel::C_Digest
bool C_Digest(SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *digest_ptr, Ulong *digest_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:473
Botan::PKCS11::LowLevel::C_SeedRandom
bool C_SeedRandom(SessionHandle session, Byte *seed_ptr, Ulong seed_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:734
Botan::PKCS11::LowLevel::C_Initialize
bool C_Initialize(VoidPtr init_args, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:84
Botan::PKCS11::MechanismType
MechanismType
Definition: p11.h:335
Botan::PKCS11::LowLevel::C_DecryptDigestUpdate
bool C_DecryptDigestUpdate(SessionHandle session, Byte *encrypted_part_ptr, Ulong encrypted_part_len, Byte *part_ptr, Ulong *part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:632
Botan::PKCS11::UserType
UserType
Definition: p11.h:812
Botan::PKCS11::LowLevel::C_Decrypt
bool C_Decrypt(SessionHandle session, Byte *encrypted_data_ptr, Ulong encrypted_data_len, Byte *data_ptr, Ulong *data_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:434
Botan::PKCS11::LowLevel::C_InitToken
bool C_InitToken(SlotId slot_id, Utf8Char *so_pin_ptr, Ulong so_pin_len, Utf8Char *label_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:205
Botan::PKCS11::LowLevel::C_SignFinal
bool C_SignFinal(SessionHandle session, Byte *signature_ptr, Ulong *signature_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:536
Botan::PKCS11::LowLevel::C_DigestEncryptUpdate
bool C_DigestEncryptUpdate(SessionHandle session, Byte *part_ptr, Ulong part_len, Byte *encrypted_part_ptr, Ulong *encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:621
CK_INFO
Definition: pkcs11t.h:86
Botan::PKCS11::secure_string
secure_vector< uint8_t > secure_string
Definition: p11.h:61
Botan::PKCS11::LowLevel::C_GetInfo
bool C_GetInfo(Info *info_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:96
Botan::PKCS11::LowLevel::C_OpenSession
bool C_OpenSession(SlotId slot_id, Flags flags, VoidPtr application, Notify notify, SessionHandle *session_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:235
Botan::PKCS11::LowLevel::C_SignInit
bool C_SignInit(SessionHandle session, Mechanism *mechanism_ptr, ObjectHandle key, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:509
Botan::PKCS11::LowLevel::C_GetMechanismInfo
bool C_GetMechanismInfo(SlotId slot_id, MechanismType type, MechanismInfo *info_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:196
Botan::PKCS11::LowLevel::C_CopyObject
bool C_CopyObject(SessionHandle session, ObjectHandle object, Attribute *attribute_template_ptr, Ulong count, ObjectHandle *new_object_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:313
Botan::PKCS11::Session
Represents a PKCS#11 session.
Definition: p11_session.h:22
Botan::PKCS11::LowLevel::C_GetSessionInfo
bool C_GetSessionInfo(SessionHandle session, SessionInfo *info_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:258
Botan::PKCS11::UserType::SO
Botan::PKCS11::LowLevel::C_CloseAllSessions
bool C_CloseAllSessions(SlotId slot_id, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:252
Botan::PKCS11::Slot
Represents a PKCS#11 Slot, i.e., a card reader.
Definition: p11_slot.h:23
Botan::PKCS11::LowLevel::C_EncryptFinal
bool C_EncryptFinal(SessionHandle session, Byte *last_encrypted_part_ptr, Ulong *last_encrypted_part_len_ptr, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:415
CK_ATTRIBUTE
Definition: pkcs11t.h:564
Botan::PKCS11::LowLevel::C_Verify
bool C_Verify(SessionHandle session, Byte *data_ptr, Ulong data_len, Byte *signature_ptr, Ulong signature_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:573
Botan::PKCS11::Bbool
CK_BBOOL Bbool
Definition: p11.h:834
Botan::PKCS11::LowLevel::C_SignUpdate
bool C_SignUpdate(SessionHandle session, Byte *part_ptr, Ulong part_len, ReturnValue *return_value=ThrowException) const
Definition: p11.cpp:528