[修改] 增加freeRTOS

1. 版本FreeRTOSv202212.01,命名为kernel;
This commit is contained in:
2023-05-06 16:43:01 +00:00
commit a345df017b
20944 changed files with 11094377 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
<table>
<tr>
<td colspan="3"><center><b>Code Size of corePKCS11 (example generated with GCC for ARM Cortex-M)</b></center></td>
</tr>
<tr>
<td><b>File</b></td>
<td><b><center>With -O1 Optimization</center></b></td>
<td><b><center>With -Os Optimization</center></b></td>
</tr>
<tr>
<td>core_pkcs11.c</td>
<td><center>0.8K</center></td>
<td><center>0.8K</center></td>
</tr>
<tr>
<td>core_pki_utils.c</td>
<td><center>0.5K</center></td>
<td><center>0.3K</center></td>
</tr>
<tr>
<td>core_pkcs11_mbedtls.c</td>
<td><center>8.9K</center></td>
<td><center>7.5K</center></td>
</tr>
<tr>
<td><b>Total estimates</b></td>
<td><b><center>10.2K</center></b></td>
<td><b><center>8.6K</center></b></td>
</tr>
</table>

View File

@ -0,0 +1,228 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.20 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<!-- Hide the default "Data Structures" tab and use the "Modules" tab for data
structures. This allows internal data structures to be hidden. -->
<tab type="modules" visible="yes" title="Data types and Constants" intro="This library defines the following data types and constants."/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="interfaces" visible="no" title="">
<tab type="interfacelist" visible="no" title="" intro=""/>
<tab type="interfaceindex" visible="no" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="no" title="">
<tab type="classlist" visible="no" title="" intro=""/>
<tab type="classindex" visible="no" title=""/>
<tab type="hierarchy" visible="no" title="" intro=""/>
<tab type="classmembers" visible="no" title="" intro=""/>
</tab>
<tab type="structs" visible="no" title="">
<tab type="structlist" visible="no" title="" intro=""/>
<tab type="structindex" visible="no" title=""/>
</tab>
<tab type="exceptions" visible="no" title="">
<tab type="exceptionlist" visible="no" title="" intro=""/>
<tab type="exceptionindex" visible="no" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="no" title="">
<tab type="filelist" visible="yes" title="Files" intro="The following files are associated with this library."/>
<tab type="globals" visible="no" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@ -0,0 +1,425 @@
/**
@mainpage Overview
@anchor core_pkcs11
@brief PKCS #11 Crypto Abstraction Library.
> PKCS #11 is a standard maintained by OASIS for interacting with cryptographic hardware.
<span style="float:right;margin-right:4em"> &mdash; <i>Official documentation of PKCS #11 from [oasis](http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html)</i></span><br>
This corePKCS11 library implements a subset of the PKCS #11 API required to establish a secure connection to AWS IoT:
- Verifying the signature of the contents of a message.
- Signing a message.
- Managing certificates and keys.
- Generating random numbers.
@section pkcs11_memory_requirements Memory Requirements
@brief Memory requirements of the PKCS #11 library.
@include{doc} size_table.md
*/
/**
@page pkcs11_design Design
@section PKCS11_Wrapper Dependencies of the corePKCS11 Wrapper for the PKCS #11 standard
Currently, the corePKCS11 library provides a wrapper header around the [PKCS #11 standard](http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html). It has dependencies on:
- `stdint.h` from the C standard library
- PKCS #11 standard.
Note: "core_pkcs11.h" should always be included first as it defines the macros that are needed by the standard PKCS #11 header files.
@dot "PKCS #11 wrapper direct dependencies"
digraph pkcs11_wrapper_dependencies
{
node[shape=box, fontname=Helvetica, fontsize=10, style=filled];
edge[fontname=Helvetica, fontsize=10];
subgraph
{
pkcs11_wrapper[label="PKCS #11 Wrapper", fillcolor="#cc00ccff"];
}
subgraph
{
node[fillcolor="#aed8a9ff"];
rank = same;
pkcs11[label="PKCS #11"];
}
pkcs11_wrapper -> pkcs11;
}
@enddot
@section PKCS11_implementation corePKCS11 Software Implementation Dependencies
The corePKCS11 library provides one implementation of the PKCS #11 standard, and it can easily be swapped out for other implementations. The corePKCS11 library documented here
is a software based implementation of the PKCS #11 standard, to allow for writing libraries and code that can easily interface with Hardware Security Modules (HSM).
Currently, the software based corePKCS11 library has the following dependencies:
- The API defined by the PKCS #11 specification. The headers used can be found [here](https://github.com/amazon-freertos/pkcs11/tree/v2.40_errata01).
- The PKCS #11 PAL layer. This is used for writing PKCS #11 objects to flash.
- [Mbed TLS](https://github.com/ARMmbed/mbedtls/tree/v2.28.0). This library uses Mbed TLS for the cryptographic logic. Some examples include parsing key and certificate objects, signing operations, and creating digests.
- The standard C library `string.h`, for memory manipulation.
@dot "PKCS #11 implementation direct dependencies"
digraph pkcs11_software_implementation_dependencies
{
node[shape=box, fontname=Helvetica, fontsize=10, style=filled];
edge[fontname=Helvetica, fontsize=10];
subgraph
{
pkcs11_software_implementation[label="PKCS #11 Software Implementation", fillcolor="#cc00ccff"];
}
subgraph
{
node[fillcolor="#aed8a9ff"];
rank = same;
pkcs11_wrapper[label="PKCS #11"];
mbedtls[label="Mbed TLS"];
pkcs11_pal[label="PKCS #11 PAL"];
}
pkcs11_software_implementation -> pkcs11_wrapper;
pkcs11_software_implementation -> mbedtls;
pkcs11_software_implementation -> pkcs11_pal;
}
@enddot
@section PKCS11_utilities corePKCS11 Utilities Dependencies
The PKI utils module is a forked version of the PKI utilities provided by Mbed TLS. They provide helper utilities to convert the format of ECDSA P-256 signatures.
The conversions provided are:
- DER format to PKCS #11 format.
- PKCS #11 format to ASN.1 format.
Currently, the module has a dependency only on the C standard library.
@dot "PKCS #11 Utilities Dependencies"
digraph pkcs11_utils_dependencies
{
node[shape=box, fontname=Helvetica, fontsize=10, style=filled];
edge[fontname=Helvetica, fontsize=10];
subgraph
{
pkcs11_utils[label="PKCS #11 Utilities", fillcolor="#cc00ccff"];
}
subgraph
{
node[fillcolor="#aed8a9ff"];
rank = same;
stdlib[label="string.h"];
}
pkcs11_utils -> stdlib;
}
@enddot
*/
/**
@page pkcs11_seq PKCS #11 Sequence Diagrams
@brief The following are sequence diagrams for common PKCS #11 operations.
@subpage pkcs11_rng_seq <br>
@subpage pkcs11_dig_seq <br>
@subpage pkcs11_obj_imp_seq <br>
@subpage pkcs11_obj_gen_seq <br>
@subpage pkcs11_sign_verify_seq <br>
@page pkcs11_rng_seq PKCS #11 RNG Sequence Diagram
@brief Sequence diagram illustrating how to generate random bytes from PKCS #11.
@image html pkcs11_rng.png "PKCS #11 RNG Sequence" width=50%
@page pkcs11_dig_seq PKCS #11 Digest Sequence Diagram
@brief Sequence diagram illustrating how to create a message digest with PKCS #11.
@image html pkcs11_digest.png "PKCS #11 Digest Sequence" width=50%
@page pkcs11_obj_imp_seq PKCS #11 Object Import Sequence Diagram
@brief Sequence diagram illustrating how to import an object with PKCS #11.
@image html pkcs11_object_import.png "PKCS #11 Object Import Sequence" width=50%
@page pkcs11_obj_gen_seq PKCS #11 Generate Key Pair Sequence Diagram
@brief Sequence diagram illustrating how to generate a key pair with PKCS #11.
@image html pkcs11_object_generate.png "PKCS #11 Generate Key Pair Sequence" width=50%
@page pkcs11_sign_verify_seq PKCS #11 Sign and Verify Sequence Diagram
@brief Sequence diagram illustrating how to sign a hash and verify a signature with PKCS #11.
@image html pkcs11_sign_verify.png "PKCS #11 Sign and Verify Sequence" width=50%
*/
/**
@page pkcs11_config PKCS #11 Configuration Macros
@brief These are the configuration macros used by the corePKCS11 Library.
@section pkcs11configPKCS11_MALLOC
@copydoc pkcs11configPKCS11_MALLOC
@section pkcs11configPKCS11_FREE
@copydoc pkcs11configPKCS11_FREE
@section pkcs11configPKCS11_DEFAULT_USER_PIN
@copydoc pkcs11configPKCS11_DEFAULT_USER_PIN
@section pkcs11configMAX_LABEL_LENGTH
@copydoc pkcs11configMAX_LABEL_LENGTH
@section pkcs11configMAX_NUM_OBJECTS
@copydoc pkcs11configMAX_NUM_OBJECTS
@section pkcs11configMAX_SESSIONS
@copydoc pkcs11configMAX_SESSIONS
@section pkcs11configPAL_DESTROY_SUPPORTED
@copydoc pkcs11configPAL_DESTROY_SUPPORTED
@section pkcs11configOTA_SUPPORTED
@copydoc pkcs11configOTA_SUPPORTED
@section pkcs11configJITP_CODEVERIFY_ROOT_CERT_SUPPORTED
@copydoc pkcs11configJITP_CODEVERIFY_ROOT_CERT_SUPPORTED
@section pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS
@copydoc pkcs11configLABEL_DEVICE_PRIVATE_KEY_FOR_TLS
@section pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS
@copydoc pkcs11configLABEL_DEVICE_PUBLIC_KEY_FOR_TLS
@section pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS
@copydoc pkcs11configLABEL_DEVICE_CERTIFICATE_FOR_TLS
@section pkcs11configLABEL_ROOT_CERTIFICATE
@copydoc pkcs11configLABEL_ROOT_CERTIFICATE
@section pkcs11configLABEL_HMAC_KEY
@copydoc pkcs11configLABEL_HMAC_KEY
@section pkcs11configLABEL_CMAC_KEY
@copydoc pkcs11configLABEL_CMAC_KEY
@section pkcs11configLABEL_CODE_VERIFICATION_KEY
@copydoc pkcs11configLABEL_CODE_VERIFICATION_KEY
@section pkcs11configLABEL_JITP_CERTIFICATE
@copydoc pkcs11configLABEL_JITP_CERTIFICATE
@section LogError
@copydoc LogError
@section LogWarn
@copydoc LogWarn
@section LogInfo
@copydoc LogInfo
@section LogDebug
@copydoc LogDebug
*/
/**
@page pkcs11_core_mbedtls_function PKCS #11 Mbed TLS Implementation Functions
@brief Primary functions of the PKCS #11 Mbed TLS based Implementation Library:<br><br>
@subpage pkcs11_mbedtls_function_c_initialize <br>
@subpage pkcs11_mbedtls_function_c_finalize <br>
@subpage pkcs11_mbedtls_function_c_getfunctionlist <br>
@subpage pkcs11_mbedtls_function_c_getslotlist <br>
@subpage pkcs11_mbedtls_function_c_gettokeninfo <br>
@subpage pkcs11_mbedtls_function_c_getmechanisminfo <br>
@subpage pkcs11_mbedtls_function_c_inittoken <br>
@subpage pkcs11_mbedtls_function_c_opensession <br>
@subpage pkcs11_mbedtls_function_c_closesession <br>
@subpage pkcs11_mbedtls_function_c_login <br>
@subpage pkcs11_mbedtls_function_c_createobject <br>
@subpage pkcs11_mbedtls_function_c_destroyobject <br>
@subpage pkcs11_mbedtls_function_c_getattributevalue <br>
@subpage pkcs11_mbedtls_function_c_findobjectsinit <br>
@subpage pkcs11_mbedtls_function_c_findobjects <br>
@subpage pkcs11_mbedtls_function_c_findobjectsfinal <br>
@subpage pkcs11_mbedtls_function_c_digestinit <br>
@subpage pkcs11_mbedtls_function_c_digestupdate <br>
@subpage pkcs11_mbedtls_function_c_digestfinal <br>
@subpage pkcs11_mbedtls_function_c_signinit <br>
@subpage pkcs11_mbedtls_function_c_verifyinit <br>
@subpage pkcs11_mbedtls_function_c_verify <br>
@subpage pkcs11_mbedtls_function_c_generatekeypair <br>
@subpage pkcs11_mbedtls_function_c_generate_random <br>
@page pkcs11_mbedtls_function_c_initialize C_Initialize
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_initialize
@copydoc C_Initialize
@page pkcs11_mbedtls_function_c_finalize C_Finalize
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_finalize
@copydoc C_Finalize
@page pkcs11_mbedtls_function_c_getfunctionlist C_GetFunctionList
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_getfunctionlist
@copydoc C_GetFunctionList
@page pkcs11_mbedtls_function_c_getslotlist C_GetSlotList
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_getslotlist
@copydoc C_GetSlotList
@page pkcs11_mbedtls_function_c_gettokeninfo C_GetTokenInfo
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_gettokeninfo
@copydoc C_GetTokenInfo
@page pkcs11_mbedtls_function_c_getmechanisminfo C_GetMechanismInfo
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_getmechanisminfo
@copydoc C_GetMechanismInfo
@page pkcs11_mbedtls_function_c_inittoken C_InitToken
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_inittoken
@copydoc C_InitToken
@page pkcs11_mbedtls_function_c_opensession C_OpenSession
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_opensession
@copydoc C_OpenSession
@page pkcs11_mbedtls_function_c_closesession C_CloseSession
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_closesession
@copydoc C_CloseSession
@page pkcs11_mbedtls_function_c_login C_Login
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_login
@copydoc C_Login
@page pkcs11_mbedtls_function_c_createobject C_CreateObject
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_createobject
@copydoc C_CreateObject
@page pkcs11_mbedtls_function_c_destroyobject C_DestroyObject
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_destroyobject
@copydoc C_DestroyObject
@page pkcs11_mbedtls_function_c_getattributevalue C_GetAttributeValue
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_getattributevalue
@copydoc C_GetAttributeValue
@page pkcs11_mbedtls_function_c_findobjectsinit C_FindObjectsInit
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_findobjectsinit
@copydoc C_FindObjectsInit
@page pkcs11_mbedtls_function_c_findobjects C_FindObjects
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_findobjects
@copydoc C_FindObjects
@page pkcs11_mbedtls_function_c_findobjectsfinal C_FindObjectsFinal
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_findobjectsfinal
@copydoc C_FindObjectsFinal
@page pkcs11_mbedtls_function_c_digestinit C_DigestInit
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_digestinit
@copydoc C_DigestInit
@page pkcs11_mbedtls_function_c_digestupdate C_DigestUpdate
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_digestupdate
@copydoc C_DigestUpdate
@page pkcs11_mbedtls_function_c_digestfinal C_DigestFinal
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_digestfinal
@copydoc C_DigestFinal
@page pkcs11_mbedtls_function_c_signinit C_SignInit
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_signinit
@copydoc C_SignInit
@page pkcs11_mbedtls_function_c_verifyinit C_VerifyInit
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_verifyinit
@copydoc C_VerifyInit
@page pkcs11_mbedtls_function_c_verify C_Verify
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_verify
@copydoc C_Verify
@page pkcs11_mbedtls_function_c_generatekeypair C_GenerateKeyPair
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_generatekeypair
@copydoc C_GenerateKeyPair
@page pkcs11_mbedtls_function_c_generate_random C_GenerateRandom
@snippet core_pkcs11_mbedtls.c declare_pkcs11_mbedtls_c_generate_random
@copydoc C_GenerateRandom
*/
/**
@page pkcs11_core_wrapper_function PKCS #11 Wrapper Functions
@brief Primary functions of the PKCS #11 wrapper Library:<br><br>
@subpage pkcs11_core_xinitializepkcs11 <br>
@subpage pkcs11_core_xgetslotlist <br>
@subpage pkcs11_core_xinitializepkcs11token <br>
@subpage pkcs11_core_xinitializepkcs11session <br>
@subpage pkcs11_core_xfindobjectwithlabelandclass <br>
@subpage pkcs11_core_vappendsha256algorithmidentifiersequence <br>
@page pkcs11_core_xinitializepkcs11 xInitializePKCS11
@snippet core_pkcs11.h declare_pkcs11_core_xinitializepkcs11
@copydoc xInitializePKCS11
@page pkcs11_core_xgetslotlist xGetSlotList
@snippet core_pkcs11.h declare_pkcs11_core_xgetslotlist
@copydoc xGetSlotList
@page pkcs11_core_xinitializepkcs11token xInitializePkcs11Token
@snippet core_pkcs11.h declare_pkcs11_core_xinitializepkcs11token
@copydoc xInitializePkcs11Token
@page pkcs11_core_xinitializepkcs11session xInitializePkcs11Session
@snippet core_pkcs11.h declare_pkcs11_core_xinitializepkcs11session
@copydoc xInitializePkcs11Session
@page pkcs11_core_xfindobjectwithlabelandclass xFindObjectWithLabelAndClass
@snippet core_pkcs11.h declare_pkcs11_core_xfindobjectwithlabelandclass
@copydoc xFindObjectWithLabelAndClass
@page pkcs11_core_vappendsha256algorithmidentifiersequence vAppendSHA256AlgorithmIdentifierSequence
@snippet core_pkcs11.h declare_pkcs11_core_vappendsha256algorithmidentifiersequence
@copydoc vAppendSHA256AlgorithmIdentifierSequence
*/
/**
@page pkcs11_core_pal_function PKCS #11 PAL Functions
@brief Primary functions of the PKCS #11 Platform Abstraction Layer Library:<br><br>
@subpage pkcs11_pal_initialize <br>
@subpage pkcs11_pal_saveobject <br>
@subpage pkcs11_pal_destroyobject <br>
@subpage pkcs11_pal_findobject <br>
@subpage pkcs11_pal_getobjectvalue <br>
@subpage pkcs11_pal_getobjectvaluecleanup <br>
@page pkcs11_pal_initialize PKCS11_PAL_Initialize
@snippet core_pkcs11_pal.h declare_pkcs11_pal_initialize
@copydoc PKCS11_PAL_Initialize
@page pkcs11_pal_saveobject PKCS11_PAL_SaveObject
@snippet core_pkcs11_pal.h declare_pkcs11_pal_saveobject
@copydoc PKCS11_PAL_SaveObject
@page pkcs11_pal_destroyobject PKCS11_PAL_DestroyObject
@snippet core_pkcs11_pal.h declare_pkcs11_pal_destroyobject
@copydoc PKCS11_PAL_DestroyObject
@page pkcs11_pal_findobject PKCS11_PAL_FindObject
@snippet core_pkcs11_pal.h declare_pkcs11_pal_findobject
@copydoc PKCS11_PAL_FindObject
@page pkcs11_pal_getobjectvalue PKCS11_PAL_GetObjectValue
@snippet core_pkcs11_pal.h declare_pkcs11_pal_getobjectvalue
@copydoc PKCS11_PAL_GetObjectValue
@page pkcs11_pal_getobjectvaluecleanup PKCS11_PAL_GetObjectValueCleanup
@snippet core_pkcs11_pal.h declare_pkcs11_pal_getobjectvaluecleanup
@copydoc PKCS11_PAL_GetObjectValueCleanup
*/
/**
@page pkcs11_core_utils_function PKCS #11 Utils Functions
@brief Primary functions of the PKCS #11 Utils Library:<br><br>
@subpage pkcs11_utils_pkipkcs11signaturetombedtlssignature <br>
@subpage pkcs11_utils_pkimbedtlssignaturetopkcs11signature <br>
@page pkcs11_utils_pkipkcs11signaturetombedtlssignature PKI_mbedTLSSignatureToPkcs11Signature
@snippet core_pki_utils.h declare_pkcs11_utils_pkipkcs11signaturetombedtlssignature
@copydoc PKI_mbedTLSSignatureToPkcs11Signature
@page pkcs11_utils_pkimbedtlssignaturetopkcs11signature PKI_pkcs11SignatureTombedTLSSignature
@snippet core_pki_utils.h declare_pkcs11_utils_pkimbedtlssignaturetopkcs11signature
@copydoc PKI_pkcs11SignatureTombedTLSSignature
*/

View File

@ -0,0 +1,132 @@
/*
* Stylesheet for Doxygen HTML output.
*
* This file defines styles for custom elements in the header/footer and
* overrides some of the default Doxygen styles.
*
* Styles in this file do not affect the treeview sidebar.
*/
/* Set the margins to place a small amount of whitespace on the left and right
* side of the page. */
div.contents {
margin-left:4em;
margin-right:4em;
}
/* Justify text in paragraphs. */
p {
text-align: justify;
}
/* Style of section headings. */
h1 {
border-bottom: 1px solid #879ECB;
color: #354C7B;
font-size: 160%;
font-weight: normal;
padding-bottom: 4px;
padding-top: 8px;
}
/* Style of subsection headings. */
h2:not(.memtitle):not(.groupheader) {
font-size: 125%;
margin-bottom: 0px;
margin-top: 16px;
padding: 0px;
}
/* Style of paragraphs immediately after subsection headings. */
h2 + p {
margin: 0px;
padding: 0px;
}
/* Style of subsection headings. */
h3 {
font-size: 100%;
margin-bottom: 0px;
margin-left: 2em;
margin-right: 2em;
}
/* Style of paragraphs immediately after subsubsection headings. */
h3 + p {
margin-top: 0px;
margin-left: 2em;
margin-right: 2em;
}
/* Style of the prefix "AWS IoT Device SDK C" that appears in the header. */
#csdkprefix {
color: #757575;
}
/* Style of the "Return to main page" link that appears in the header. */
#returntomain {
padding: 0.5em;
}
/* Style of the dividers on Configuration Settings pages. */
div.configpagedivider {
margin-left: 0px !important;
margin-right: 0px !important;
margin-top: 20px !important;
}
/* Style of configuration setting names. */
dl.section.user ~ h1 {
border-bottom: none;
color: #000000;
font-family: monospace, fixed;
font-size: 16px;
margin-bottom: 0px;
margin-left: 2em;
margin-top: 1.5em;
}
/* Style of paragraphs on a configuration settings page. */
dl.section.user ~ * {
margin-bottom: 10px;
margin-left: 4em;
margin-right: 4em;
margin-top: 0px;
}
/* Hide the configuration setting marker. */
dl.section.user {
display: none;
}
/* Overrides for code fragments and lines. */
div.fragment {
background: #ffffff;
border: none;
padding: 5px;
}
div.line {
color: #3a3a3a;
}
/* Overrides for code syntax highlighting colors. */
span.comment {
color: #008000;
}
span.keyword, span.keywordtype, span.keywordflow {
color: #0000ff;
}
span.preprocessor {
color: #50015a;
}
span.stringliteral, span.charliteral {
color: #800c0c;
}
a.code, a.code:visited, a.line, a.line:visited {
color: #496194;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,38 @@
@startuml
skinparam classFontSize 8
skinparam classFontName Helvetica
autonumber
participant "Application" as app
participant "PKCS #11" as pkcs
box "PKCS #11 - Creating A Message Digest" #LightBlue
participant app
participant pkcs
end box
app -> pkcs: Acquire function list with C_GetFunctionList
pkcs -> app: Return CK_FUNCTION_LIST_PTR with supported functions
app -> pkcs: Initialize with C_Initialize
app -> pkcs: Query for a slot with C_GetSlotList
pkcs -> app: Return an array of CK_SLOT_IDs
app -> pkcs: Open a new session with a slot using C_OpenSession
pkcs -> app: Return a CK_SESSION_HANDLE
app -> pkcs: Log in to current session with C_Login
app -> pkcs: Query for supported mechanisms with C_GetMechanismInfo
pkcs -> app: Return CK_MECHANISM_INFO
app -> pkcs: Start a digest operation using SHA-256 by passing CKM_SHA256 to C_DigestInit
app -> pkcs: Pass bytes buffer of message to C_DigestUpdate
app -> pkcs: Pass bytes buffer for storing the digest to C_DigestFinal
pkcs -> app: Fill buffer with digest bytes
app -> pkcs: Close session with C_CloseSession
app -> pkcs: Uninitialize with C_Finalize
@enduml

View File

@ -0,0 +1,33 @@
@startuml
skinparam classFontSize 8
skinparam classFontName Helvetica
autonumber
participant "Application" as app
participant "PKCS #11" as pkcs
box "PKCS #11 - Generating A Key Pair" #LightBlue
participant app
participant pkcs
end box
app -> pkcs: Acquire function list with C_GetFunctionList
pkcs -> app: Return CK_FUNCTION_LIST_PTR with supported functions
app -> pkcs: Initialize with C_Initialize
app -> pkcs: Query for a slot with C_GetSlotList
pkcs -> app: Return an array of CK_SLOT_IDs
app -> pkcs: Open a new session with a slot using C_OpenSession
pkcs -> app: Return a CK_SESSION_HANDLE
app -> pkcs: Log in to current session with C_Login
app -> pkcs: Pass CK_ATTRIBUTEs template to C_CreateKeyPair
pkcs -> app: Return CK_OBJECT_HANDLE for public key and for private key
app -> pkcs: Close session with C_CloseSession
app -> pkcs: Uninitialize with C_Finalize
@endumlf

View File

@ -0,0 +1,33 @@
@startuml
skinparam classFontSize 8
skinparam classFontName Helvetica
autonumber
participant "Application" as app
participant "PKCS #11" as pkcs
box "PKCS #11 - Importing A Crypto Object" #LightBlue
participant app
participant pkcs
end box
app -> pkcs: Acquire function list with C_GetFunctionList
pkcs -> app: Return CK_FUNCTION_LIST_PTR with supported functions
app -> pkcs: Initialize with C_Initialize
app -> pkcs: Query for a slot with C_GetSlotList
pkcs -> app: Return an array of CK_SLOT_IDs
app -> pkcs: Open a new session with a slot using C_OpenSession
pkcs -> app: Return a CK_SESSION_HANDLE
app -> pkcs: Log in to current session with C_Login
app -> pkcs: Pass Attribute template to C_CreateObject
pkcs -> app: Return CK_OBJECT_HANDLE associated with the new object
app -> pkcs: Close session with C_CloseSession
app -> pkcs: Uninitialize with C_Finalize
@enduml

View File

@ -0,0 +1,33 @@
@startuml
skinparam classFontSize 8
skinparam classFontName Helvetica
autonumber
participant "Application" as app
participant "PKCS #11" as pkcs
box "PKCS #11 - Generating A Random Number" #LightBlue
participant app
participant pkcs
end box
app -> pkcs: Acquire function list with C_GetFunctionList
pkcs -> app: Return CK_FUNCTION_LIST_PTR with supported functions
app -> pkcs: Initialize with C_Initialize
app -> pkcs: Query for a slot with C_GetSlotList
pkcs -> app: Return an array of CK_SLOT_IDs
app -> pkcs: Open a new session with a slot using C_OpenSession
pkcs -> app: Return a CK_SESSION_HANDLE
app -> pkcs: Log in to current session with C_Login
app -> pkcs: Request an array of random bytes with C_GenerateRandom
pkcs -> app: Return an array of random bytes
app -> pkcs: Close session with C_CloseSession
app -> pkcs: Uninitialize with C_Finalize
@enduml

View File

@ -0,0 +1,49 @@
@startuml
skinparam classFontSize 8
skinparam classFontName Helvetica
autonumber
participant "Application" as app
participant "PKCS #11" as pkcs
box "PKCS #11 - Signing And Verifying A Signature" #LightBlue
participant app
participant pkcs
end box
app -> pkcs: Acquire function list with C_GetFunctionList
pkcs -> app: Return CK_FUNCTION_LIST_PTR with supported functions
app -> pkcs: Initialize with C_Initialize
app -> pkcs: Query for a slot with C_GetSlotList
pkcs -> app: Return an array of CK_SLOT_IDs
app -> pkcs: Open a new session with a slot using C_OpenSession
pkcs -> app: Return a CK_SESSION_HANDLE
app -> pkcs: Log in to current session with C_Login
app -> pkcs: Initiate a find operation by passing a CK_ATTRIBUTEs template to C_FindObjectsInit
app -> pkcs: Request a CK_OBJECT_HANDLE
pkcs -> app: Return CK_OBJECT_HANDLE for the appropriate object
app -> pkcs: Clean up find operation with C_FindObjectsFinal
app -> pkcs: Start a digest operation using SHA-256 by passing CKM_SHA256 C_DigestInit
app -> pkcs: Provide bytes buffer of message to hash with C_DigestUpdate
app -> pkcs: Provide bytes buffer to store digest in with C_DigestFinal
pkcs -> app: Fill buffer with digest bytes
app -> pkcs: Start a sign operation by passing the signature mechanism and private key handle to C_SignInit
app -> pkcs: Provide bytes buffer of message hash and bytes buffer to store the signature to C_Sign
pkcs -> app: Fill signature buffer with signature bytes of hash buffer
app -> pkcs: Start a verify operation by passing the verify mechanism and public key handle to C_VerifyInit
app -> pkcs: Provide bytes buffer of message hash and bytes buffer of the signature to C_Verify
pkcs -> app: Return OK if public key could verify signature
app -> pkcs: Close session with C_CloseSession
app -> pkcs: Uninitialize with C_Finalize
@endumla