|
| 1 | +/** |
| 2 | + * \mainpage wolfPKCS11 Documentation |
| 3 | + * |
| 4 | + * \section intro Introduction |
| 5 | + * |
| 6 | + * wolfPKCS11 is a PKCS#11 (Cryptoki) implementation backed by wolfSSL's |
| 7 | + * wolfCrypt. It provides a standard API for cryptographic tokens such as HSMs, |
| 8 | + * smart cards, and software tokens. |
| 9 | + * |
| 10 | + * \section scope Scope |
| 11 | + * |
| 12 | + * This documentation focuses on the public PKCS#11 API exposed by |
| 13 | + * wolfPKCS11 via wolfpkcs11/pkcs11.h. Functions are organized into logical |
| 14 | + * groups that follow the typical PKCS#11 application workflow. |
| 15 | + * |
| 16 | + * \section api_groups API Organization |
| 17 | + * |
| 18 | + * The PKCS#11 API is organized into the following functional groups, |
| 19 | + * listed in the typical order of use: |
| 20 | + * |
| 21 | + * 1. **\ref pkcs11_01_core "Core"** - Library initialization and finalization |
| 22 | + * 2. **\ref pkcs11_02_slot_token "SlotsAndTokens"** - Slot and token management |
| 23 | + * 3. **\ref pkcs11_03_session "Sessions"** - Session management and authentication |
| 24 | + * 4. **\ref pkcs11_04_object "Objects"** - Object creation and management |
| 25 | + * 5. **\ref pkcs11_05_key "KeyManagement"** - Key generation and key operations |
| 26 | + * 6. **\ref pkcs11_06_random "Random"** - Random number generation |
| 27 | + * 7. **\ref pkcs11_07_digest "Digest"** - Message digest operations |
| 28 | + * 8. **\ref pkcs11_08_encrypt_decrypt "EncryptDecrypt"** - Encryption and decryption |
| 29 | + * 9. **\ref pkcs11_09_sign_verify "SignVerify"** - Digital signatures |
| 30 | + * 10. **\ref pkcs11_10_extensions "wolfPKCS11 Extensions"** - wolfPKCS11-specific extensions |
| 31 | + * |
| 32 | + * \section getting_started Getting Started |
| 33 | + * |
| 34 | + * The typical application flow follows these steps: |
| 35 | + * |
| 36 | + * \code |
| 37 | + * // 1. Get the function list |
| 38 | + * CK_FUNCTION_LIST_PTR p11; |
| 39 | + * rv = C_GetFunctionList(&p11); |
| 40 | + * |
| 41 | + * // 2. Initialize the library |
| 42 | + * rv = p11->C_Initialize(NULL_PTR); |
| 43 | + * |
| 44 | + * // 3. Get available slots |
| 45 | + * rv = p11->C_GetSlotList(CK_TRUE, NULL_PTR, &slotCount); |
| 46 | + * |
| 47 | + * // 4. Open a session |
| 48 | + * rv = p11->C_OpenSession(slotID, CKF_SERIAL_SESSION | CKF_RW_SESSION, |
| 49 | + * NULL_PTR, NULL_PTR, &hSession); |
| 50 | + * |
| 51 | + * // 5. Login if required |
| 52 | + * rv = p11->C_Login(hSession, CKU_USER, pin, pinLen); |
| 53 | + * |
| 54 | + * // 6. Create or find objects (keys, certificates) |
| 55 | + * rv = p11->C_FindObjectsInit(hSession, template, templateCount); |
| 56 | + * |
| 57 | + * // 7. Perform cryptographic operations |
| 58 | + * rv = p11->C_EncryptInit(hSession, &mechanism, hKey); |
| 59 | + * rv = p11->C_Encrypt(hSession, plaintext, plaintextLen, ciphertext, &ciphertextLen); |
| 60 | + * |
| 61 | + * // 8. Cleanup |
| 62 | + * rv = p11->C_Logout(hSession); |
| 63 | + * rv = p11->C_CloseSession(hSession); |
| 64 | + * rv = p11->C_Finalize(NULL_PTR); |
| 65 | + * \endcode |
| 66 | + * |
| 67 | + * \section workflow Application Workflow |
| 68 | + * |
| 69 | + * ### Initialization Phase |
| 70 | + * - Use \ref pkcs11_01_core "Core" functions to initialize the library |
| 71 | + * - Use \ref pkcs11_02_slot_token "SlotsAndTokens" functions to discover available tokens |
| 72 | + * - Use \ref pkcs11_03_session "Sessions" functions to establish a session |
| 73 | + * |
| 74 | + * ### Setup Phase |
| 75 | + * - Use \ref pkcs11_04_object "Objects" functions to find existing keys/certificates |
| 76 | + * - Use \ref pkcs11_05_key "KeyManagement" functions to generate new keys if needed |
| 77 | + * - Use \ref pkcs11_06_random "Random" functions for nonce generation |
| 78 | + * |
| 79 | + * ### Operations Phase |
| 80 | + * - Use \ref pkcs11_07_digest "Digest" functions for hashing |
| 81 | + * - Use \ref pkcs11_08_encrypt_decrypt "EncryptDecrypt" functions for data protection |
| 82 | + * - Use \ref pkcs11_09_sign_verify "SignVerify" functions for authentication |
| 83 | + * |
| 84 | + * ### Cleanup Phase |
| 85 | + * - Close sessions and finalize the library |
| 86 | + * |
| 87 | + * \section extensions wolfPKCS11 Extensions |
| 88 | + * |
| 89 | + * wolfPKCS11 provides several extensions beyond the standard PKCS#11 specification: |
| 90 | + * - Use \ref pkcs11_10_extensions "wolfPKCS11 Extensions" for debugging and wolfSSL integration |
| 91 | + * - Debug logging functions for troubleshooting |
| 92 | + * - Custom attributes for wolfSSL crypto callback integration |
| 93 | + * - STM32U5 DHUK support for hardware-specific features |
| 94 | + * - NSS compatibility extensions: |
| 95 | + * - See \ref pkcs11_nss_extensions_overview "NSS Extensions Overview" |
| 96 | + * - \ref pkcs11_nss_mechanisms "NSS Mechanisms" |
| 97 | + * - \ref pkcs11_nss_objects "NSS Object Types" |
| 98 | + * - \ref pkcs11_nss_attributes "NSS Attributes" |
| 99 | + * - \ref pkcs11_nss_structures "NSS Parameter Structures" |
| 100 | + * - \ref pkcs11_nss_examples "NSS Extension Examples" |
| 101 | + * - \ref pkcs11_nss_compatibility "NSS Compatibility Notes" |
| 102 | + * |
| 103 | + * \section data_structs Data Structures |
| 104 | + * |
| 105 | + * For definitions of the PKCS#11 data structures supported by wolfPKCS11, see \ref data_structures.h "data_structures.h". These populate Doxygen's "Data Structure Index" and "Data Structure Documentation". |
| 106 | + * |
| 107 | + * \section standards Standards Compliance |
| 108 | + * |
| 109 | + * wolfPKCS11 implements PKCS#11 v2.40 specification. For detailed information |
| 110 | + * about the standard, refer to the OASIS PKCS#11 Cryptographic Token Interface Standard |
| 111 | + * |
| 112 | + * \section support Support and Examples |
| 113 | + * |
| 114 | + * For additional help: |
| 115 | + * - Check the examples/ directory for sample applications |
| 116 | + * - Visit wolfSSL documentation at docs.wolfssl.com |
| 117 | + * - Contact wolfSSL support for commercial licensing and support |
| 118 | + */ |
0 commit comments