Skip to content

Commit 4b5dae0

Browse files
authored
Replace PKCS11 with PKCS #11
1 parent 401a03b commit 4b5dae0

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/pkcs11/README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# PKCS11 Test
1+
# PKCS #11 Test
22

33
## On this page:
44
1. [Introduction](#1-introduction)
5-
2. [PKCS11 Test Configurations](#2-pkcs11-test-configurations)
6-
3. [Prerequisites For PKCS11 Test](#3-prerequisites-for-pkcs11-test)
5+
2. [PKCS #11 Test Configurations](#2-pkcs-11-test-configurations)
6+
3. [Prerequisites For PKCS #11 Test](#3-prerequisites-for-pkcs-11-test)
77
4. [Source Code Organization](#4-source-code-organization)
8-
5. [Implement PKCS11 Test Application](#5-implement-pkcs11-test-application)
9-
6. [Run The PKCS11 Test](#6-run-the-pkcs11-test)<br>
8+
5. [Implement PKCS #11 Test Application](#5-implement-pkcs-11-test-application)
9+
6. [Run The PKCS #11 Test](#6-run-the-pkcs-11-test)<br>
1010
</t>6.1 [Setup the provisioning mechanism and key function](#61-setup-the-provisioning-mechanism-and-key-function)<br>
11-
</t>6.2 [Compile and run the PKCS11 test application](#62-compile-and-run-the-pkcs11-test-application)<br>
11+
</t>6.2 [Compile and run the PKCS #11 test application](#62-compile-and-run-the-pkcs-11-test-application)<br>
1212

1313
## 1. Introduction
1414
[PKCS #11 ](https://en.wikipedia.org/wiki/PKCS_11) is a standardize API to allow application software to use, create, modify and delete cryptographic objects.
15-
The benefit of PKCS11 is that it allows the app to take advantage of offload crypto while mitigating the threats of private key cloning and theft.
15+
The benefit of PKCS #11 is that it allows the app to take advantage of offload crypto while mitigating the threats of private key cloning and theft.
1616

17-
FreeRTOS uses a subset of PKCS11 APIs to keep lean. Implementers are free to integrate more than our required subset of PKCS #11, but it is optional to do so.
17+
FreeRTOS uses a subset of PKCS #11 APIs to keep lean. Implementers are free to integrate more than our required subset of PKCS #11, but it is optional to do so.
1818

1919
The PKCS #11 API functions required by FreeRTOS are described in the following table.
2020

@@ -26,11 +26,11 @@ TLS | Random, Sign, FindObject, GetAttributeValue
2626
FreeRTOS+TCP | Random, Digest
2727
OTA | Verify, Digest, FindObject, GetAttributeValue
2828

29-
The PKCS11 test validates the PKCS11 subset implementation. The test directly exercises the PKCS11 implementation on the device under testing. User runs the PKCS11 test by running a test application. The test application is usually implemented by calling the provided PKCS11 test routine from the main function. By passing this test, the PKCS11 subset implementation is validated to support required PKCS11 functions by FreeRTOS.
29+
The PKCS #11 test validates the PKCS #11 subset implementation. The test directly exercises the PKCS #11 implementation on the device under testing. User runs the PKCS #11 test by running a test application. The test application is usually implemented by calling the provided PKCS #11 test routine from the main function. By passing this test, the PKCS #11 subset implementation is validated to support required PKCS #11 functions by FreeRTOS.
3030

31-
## 2. PKCS11 Test Configurations
31+
## 2. PKCS #11 Test Configurations
3232

33-
The following table lists the required test configurations for PKCS11 tests. These test configurations need to be defined in **test_param_config.h**.
33+
The following table lists the required test configurations for PKCS #11 tests. These test configurations need to be defined in **test_param_config.h**.
3434

3535
|Configuration |Description |
3636
|--- | --- |
@@ -48,7 +48,7 @@ The following table lists the required test configurations for PKCS11 tests. The
4848
|PKCS11_TEST_LABEL_ROOT_CERTIFICATE |The label of the code verification key used in JITP codeverify test. |
4949

5050

51-
FreeRTOS libraries and reference integrations needs at least one of the key function and one of the key provisioning mechanism supported by the PKCS11 APIs. The test must enable at least one of the following configurations:
51+
FreeRTOS libraries and reference integrations needs at least one of the key function and one of the key provisioning mechanism supported by the PKCS #11 APIs. The test must enable at least one of the following configurations:
5252

5353
* At least one of the key function configurations:
5454
* PKCS11_TEST_RSA_KEY_SUPPORT
@@ -63,7 +63,7 @@ Pre-provisioned device credential test can not be enabled with other provisionin
6363

6464
* Enable **PKCS11_TEST_PREPROVISIONED_SUPPORT** and the other provisioning mechanisms must be disabled
6565
* Only one of the key function, **PKCS11_TEST_RSA_KEY_SUPPORT** or **PKCS11_TEST_EC_KEY_SUPPORT**, enabled
66-
* Setup the pre-provisioned key labels according to your key function, including **PKCS11_TEST_LABEL_DEVICE_PRIVATE_KEY_FOR_TLS**, **PKCS11_TEST_LABEL_DEVICE_PUBLIC_KEY_FOR_TLS** and **PKCS11_TEST_LABEL_DEVICE_CERTIFICATE_FOR_TLS**. These credentials must exist in the PKCS11 before running the test.
66+
* Setup the pre-provisioned key labels according to your key function, including **PKCS11_TEST_LABEL_DEVICE_PRIVATE_KEY_FOR_TLS**, **PKCS11_TEST_LABEL_DEVICE_PUBLIC_KEY_FOR_TLS** and **PKCS11_TEST_LABEL_DEVICE_CERTIFICATE_FOR_TLS**. These credentials must exist in the PKCS #11 before running the test.
6767

6868
You may need to run the test several times with different configurations if your implementation support pre-provisioned credentials and other provisioning mechanisms.
6969

@@ -72,19 +72,19 @@ You may need to run the test several times with different configurations if your
7272
Objects with label **PKCS11_TEST_LABEL_DEVICE_PRIVATE_KEY_FOR_TLS**, **PKCS11_TEST_LABEL_DEVICE_PUBLIC_KEY_FOR_TLS** and **PKCS11_TEST_LABEL_DEVICE_CERTIFICATE_FOR_TLS** will be erased during the test if any one of **PKCS11_TEST_GENERATE_KEYPAIR_SUPPORT** and **PKCS11_TEST_GENERATE_KEYPAIR_SUPPORT** is enabled.
7373

7474

75-
## 3. Prerequisites For PKCS11 Test
76-
The PKCS11 tests assume the tested platform already has the following components integrated.
77-
* **The PKCS11 APIs subset implementation**<br>
75+
## 3. Prerequisites For PKCS #11 Test
76+
The PKCS #11 tests assume the tested platform already has the following components integrated.
77+
* **The PKCS #11 APIs subset implementation**<br>
7878
The implementation should support the APIs list in this [section](#1-introduction).
7979
* **corePKCS11**<br>
80-
The utilities in corePKCS11 are used in PKCS11 test. The software based mock implementation is up to developer's implementation choice.
80+
The utilities in corePKCS #11 are used in PKCS #11 test. The software based mock implementation is up to developer's implementation choice.
8181
* **MbedTLS**<br>
82-
MbedTLS is required to verify the result of the PKCS11 implementation.
82+
MbedTLS is required to verify the result of the PKCS #11 implementation.
8383
* **Unity test framework**<br>
84-
PKCS11 test make use of the Unity test framework. Reference the [website](https://github.com/ThrowTheSwitch/Unity) for integration guide.
84+
PKCS #11 test make use of the Unity test framework. Reference the [website](https://github.com/ThrowTheSwitch/Unity) for integration guide.
8585

8686
## 4. Source Code Organization
87-
The tree only lists the required files to run the PKCS11 test.
87+
The tree only lists the required files to run the PKCS #11 test.
8888
```
8989
./FreeRTOS-Libraries-Integration-Tests/
9090
├── config_template
@@ -105,12 +105,12 @@ The tree only lists the required files to run the PKCS11 test.
105105
└── qualification_test.h
106106
```
107107

108-
## 5. Implement PKCS11 Test Application
108+
## 5. Implement PKCS #11 Test Application
109109
1. Add [FreeRTOS-Libraries-Integration-Tests](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests) as a submodule into your project. It doesn’t matter where the submodule is placed in the project, as long as it can be built.
110110
2. Copy **config_template/test_execution_config_template.h** and **config_template/test_param_config_template.h** to a project location in the build path, and rename them to **test_execution_config.h** and **test_param_config.h**.
111111
3. Include relevant files into the build system. If using CMake, **qualification_test.cmake** and **src/pkcs11_test.cmake** can be used to include relevant files.
112-
4. Implement the [platform functions](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/blob/main/src/common/platform_function.h) required by PKCS11 tests.
113-
5. Enable the PKCS11 test config, **PKCS11_TEST_ENABLED**, in **test_execution_config.h**.
112+
4. Implement the [platform functions](https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests/blob/main/src/common/platform_function.h) required by PKCS #11 tests.
113+
5. Enable the PKCS #11 test config, **PKCS11_TEST_ENABLED**, in **test_execution_config.h**.
114114
6. Implement the main function and call the **RunQualificationTest**.
115115

116116
The following is an example test application.
@@ -131,7 +131,7 @@ int FRTest_ThreadTimedJoin( FRTestThreadHandle_t threadHandle, uint32_t timeoutM
131131

132132
void FRTest_TimeDelay( uint32_t delayMs )
133133
{
134-
/* Delay function to wait for PKCS11 result. */
134+
/* Delay function to wait for PKCS #11 result. */
135135
}
136136

137137
void * FRTest_MemoryAlloc( size_t size )
@@ -151,10 +151,10 @@ void yourMainFunction( void )
151151

152152
```
153153
154-
## 6. Run The PKCS11 Test
154+
## 6. Run The PKCS #11 Test
155155
### 6.1 Setup the provisioning mechanism and key function
156156
Setup the provisioning mechanism and key function in **test_param_config.h** according to the device capability.
157-
The following is a sample test_param_config.h if corePKCS11 is used for the PKCS11 implementation.
157+
The following is a sample test_param_config.h if corePKCS11 is used for the PKCS #11 implementation.
158158
```C
159159
#include "core_pkcs11_config.h"
160160
@@ -179,7 +179,7 @@ The following is a sample test_param_config.h if corePKCS11 is used for the PKCS
179179
#define PKCS11_TEST_LABEL_ROOT_CERTIFICATE pkcs11configLABEL_ROOT_CERTIFICATE
180180
```
181181

182-
### 6.2 Compile and run the PKCS11 test application
182+
### 6.2 Compile and run the PKCS #11 test application
183183
Compile and run the test application in your development environment.
184184
The following is a sample test result log:
185185
```

0 commit comments

Comments
 (0)