You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PKCS #11](https://en.wikipedia.org/wiki/PKCS_11) is a standardized and widely used API for manipulating common cryptographic objects. It is important because the functions it specifies allow application software to use, create, modify, and delete cryptographic objects, without ever exposing those objects to the application’s memory.
3
-
For example, FreeRTOS AWS reference integrations use a small subset of the PKCS #11 API to, among other things, access the secret (private) key necessary to create a network connection that is authenticated and secured by the [Transport Layer Security (TLS)](https://en.wikipedia.org/wiki/Transport_Layer_Security) protocol – without the application ever ‘seeing’ the key.
4
2
5
-
6
-
The Cryptoki or PKCS #11 standard defines a platform-independent API to manage and use cryptographic tokens. The name, "PKCS #11", is used interchangeably to refer to the API itself and the standard which defines it.
7
-
8
-
This repository contains a software based mock implementation of the PKCS #11 interface (API) that uses the cryptographic functionality provided by Mbed TLS. Using a software mock enables rapid development and flexibility, but it is expected that the mock be replaced by an implementation specific to your chosen secure key storage in production devices.
9
-
10
-
Only a subset of the PKCS #11 standard is implemented, with a focus on operations involving asymmetric keys, random number generation, and hashing.
11
-
12
-
The targeted use cases include certificate and key management for TLS authentication and code-sign signature verification, on small embedded devices.
13
-
14
-
corePKCS11 is implemented on PKCS #11 v2.4.0, the full PKCS #11 standard can be found on the [oasis website](http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html).
15
-
16
-
This library has gone through code quality checks including verification that no function has a [GNU Complexity](https://www.gnu.org/software/complexity/manual/complexity.html) score over 8, and checks against deviations from mandatory rules in the [MISRA coding standard](https://www.misra.org.uk). Deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](MISRA.md). This library has also undergone both static code analysis from [Coverity static analysis](https://scan.coverity.com/) and validation of memory safety through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/).
17
-
18
-
See memory requirements for this library [here](./docs/doxygen/include/size_table.md).
19
-
20
-
**corePKCS11 v3.5.0 [source code](https://github.com/FreeRTOS/corePKCS11/tree/v3.5.0/source) is part of the [FreeRTOS 202210.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS) release.**
21
-
22
-
**corePKCS11 v3.0.0 [source code](https://github.com/FreeRTOS/corePKCS11/tree/v3.0.0/source) is part of the [FreeRTOS 202012.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202012.00-LTS) release.**
3
+
**[API Documentation Pages for current and previous releases of this library can be found here](https://freertos.github.io/corePKCS11/)**
4
+
5
+
[PKCS #11](https://en.wikipedia.org/wiki/PKCS_11) is a standardized and widely
6
+
used API for manipulating common cryptographic objects. It is important because
7
+
the functions it specifies allow application software to use, create, modify,
8
+
and delete cryptographic objects, without ever exposing those objects to the
9
+
application’s memory. For example, FreeRTOS AWS reference integrations use a
10
+
small subset of the PKCS #11 API to, among other things, access the secret
11
+
(private) key necessary to create a network connection that is authenticated and
Generally vendors for secure cryptoprocessors such as Trusted Platform Module ([TPM](https://en.wikipedia.org/wiki/Trusted_Platform_Module)), Hardware Security Module ([HSM](https://en.wikipedia.org/wiki/Hardware_security_module)), Secure Element, or any other type of secure hardware enclave, distribute a PKCS #11 implementation with the hardware.
27
-
The purpose of the corePKCS11 software only mock library is therefore to provide a non hardware specific PKCS #11 implementation that allows for rapid prototyping and development before switching to a cryptoprocessor specific PKCS #11 implementation in production devices.
28
-
29
-
Since the PKCS #11 interface is defined as part of the PKCS #11[specification](https://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html) replacing this library with another implementation should require little porting effort, as the interface will not change. The system tests distributed in this repository can be leveraged to verify the behavior of a different implementation is similar to corePKCS11.
64
+
Generally vendors for secure cryptoprocessors such as Trusted Platform Module
replacing this library with another implementation should require little porting
77
+
effort, as the interface will not change. The system tests distributed in this
78
+
repository can be leveraged to verify the behavior of a different implementation
79
+
is similar to corePKCS11.
30
80
31
81
## corePKCS11 Configuration
32
82
33
-
The corePKCS11 library exposes preprocessor macros which must be defined prior to building the library.
34
-
A list of all the configurations and their default values are defined in the doxygen documentation for this library.
83
+
The corePKCS11 library exposes preprocessor macros which must be defined prior
84
+
to building the library. A list of all the configurations and their default
85
+
values are defined in the doxygen documentation for this library.
35
86
36
87
## Build Prerequisites
88
+
37
89
### Library Usage
90
+
38
91
For building the library the following are required:
92
+
39
93
-**A C99 compiler**
40
-
-**mbedcrypto** library from [mbedtls](https://github.com/ARMmbed/mbedtls) version 2.x or 3.x.
41
-
-**pkcs11 API header(s)** available from [OASIS](https://github.com/oasis-tcs/pkcs11) or [OpenSC](https://github.com/OpenSC/libp11/blob/master/src/pkcs11.h)
94
+
-**mbedcrypto** library from [mbedtls](https://github.com/ARMmbed/mbedtls)
The `test/cbmc/proofs` directory contains CBMC proofs.
85
157
86
-
In order to run these proofs you will need to install CBMC and other tools by following the instructions [here](https://model-checking.github.io/cbmc-training/installation.html).
158
+
In order to run these proofs you will need to install CBMC and other tools by
The FreeRTOS-Labs repository contains demos using the PKCS #11 library [here](https://github.com/FreeRTOS/FreeRTOS-Labs/tree/master/FreeRTOS-Plus/Demo/FreeRTOS_Plus_PKCS11_Windows_Simulator/examples) using FreeRTOS on the Windows simulator platform. These can be used as reference examples for the library API.
164
+
The FreeRTOS-Labs repository contains demos using the PKCS #11 library
using FreeRTOS on the Windows simulator platform. These can be used as reference
167
+
examples for the library API.
91
168
92
169
## Porting Guide
93
-
Documentation for porting corePKCS11 to a new platform can be found on the AWS [docs](https://docs.aws.amazon.com/freertos/latest/portingguide/afr-porting-pkcs.html) web page.
94
170
95
-
corePKCS11 is not meant to be ported to projects that have a TPM, HSM, or other hardware for offloading crypto-processing. This library is specifically meant to be used for development and prototyping.
171
+
Documentation for porting corePKCS11 to a new platform can be found on the AWS
corePKCS11 is not meant to be ported to projects that have a TPM, HSM, or other
176
+
hardware for offloading crypto-processing. This library is specifically meant to
177
+
be used for development and prototyping.
97
178
98
179
## Related Example Implementations
99
-
These projects implement the PKCS #11 interface on real hardware and have similar behavior to corePKCS11. It is preferred to use these, over corePKCS11, as they allow for offloading Cryptography to separate hardware.
0 commit comments