### Basic CMakeLists.txt Configuration Source: https://github.com/nxp/plug-and-trust/blob/master/ecc_example/CMakeLists.txt Sets up the minimum CMake version, project name, and includes a library definition file. ```cmake CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0) project (ex_ecc) SET(SIMW_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) INCLUDE(${SIMW_LIB_DIR}/simw_lib.cmake) ``` -------------------------------- ### Configure SE05x Authentication Source: https://github.com/nxp/plug-and-trust/blob/master/README.rst Select the authentication method for connecting to the SE Applet. Ensure PTMW_HostCrypto is set to Openssl when using authentication. ```bash -DPTMW_SE05X_Auth=None ``` ```bash -DPTMW_SE05X_Auth=UserID ``` ```bash -DPTMW_SE05X_Auth=PlatfSCP03 ``` ```bash -DPTMW_SE05X_Auth=AESKey ``` ```bash -DPTMW_SE05X_Auth=ECKey ``` ```bash -DPTMW_SE05X_Auth=UserID_PlatfSCP03 ``` ```bash -DPTMW_SE05X_Auth=AESKey_PlatfSCP03 ``` ```bash -DPTMW_SE05X_Auth=ECKey_PlatfSCP03 ``` -------------------------------- ### Open Session APIs for SE05x Source: https://github.com/nxp/plug-and-trust/blob/master/README.rst These APIs are used to open a session with the SE05x device. They abstract the necessary actions for establishing a connection. Include 'ex_sss_main_inc.h' for simplified session opening. ```c sss_status_t ex_sss_boot_connectstring(int argc, const char *argv[], char **pPortName); sss_status_t ex_sss_boot_open(ex_sss_boot_ctx_t *pCtx, const char *portName); sss_status_t ex_sss_key_store_and_object_init(ex_sss_boot_ctx_t *pCtx); ``` ```c sss_status_t ex_sss_entry(ex_sss_boot_ctx_t *pCtx) ``` -------------------------------- ### Configure SE05X Version Source: https://github.com/nxp/plug-and-trust/blob/master/README.rst Use this build flag to select the SE05X version. Version 07_00 enables SE051/SE052 features. ```bash -DPTMW_SE05X_Ver=03_XX ``` ```bash -DPTMW_SE05X_Ver=07_02 ``` -------------------------------- ### Configure Host Crypto Library Source: https://github.com/nxp/plug-and-trust/blob/master/README.rst Specify the cryptographic library to be used on the host. OpenSSL is the currently supported option. ```bash -DPTMW_HostCrypto=OPENSSL ``` ```bash -DPTMW_HostCrypto=None ``` -------------------------------- ### Setting Include Directories Source: https://github.com/nxp/plug-and-trust/blob/master/ecc_example/CMakeLists.txt Specifies public include directories for the project, including the parent directory and a SIMW include directory. ```cmake TARGET_INCLUDE_DIRECTORIES( ${PROJECT_NAME} PUBLIC ../ ${SIMW_INC_DIR} ) ``` -------------------------------- ### Conditional Library Linking for OpenSSL Source: https://github.com/nxp/plug-and-trust/blob/master/ecc_example/CMakeLists.txt Links the 'ssl' and 'crypto' libraries to the project if PTMW_HostCrypto is set to OPENSSL. ```cmake IF("${PTMW_HostCrypto}" STREQUAL "OPENSSL") TARGET_LINK_LIBRARIES(${PROJECT_NAME} ssl crypto) ENDIF() ``` -------------------------------- ### Conditional Executable Addition Source: https://github.com/nxp/plug-and-trust/blob/master/ecc_example/CMakeLists.txt Adds the main executable, conditionally including authentication sources based on the PTMW_SE05X_Auth variable. ```cmake IF("${PTMW_SE05X_Auth}" STREQUAL "None") ADD_EXECUTABLE(${PROJECT_NAME} ${SIMW_SE_SOURCES} ../sss/ex/ecc/ex_sss_ecc.c) ELSE() ADD_EXECUTABLE(${PROJECT_NAME} ${SIMW_SE_SOURCES} ${SIMW_SE_AUTH_SOURCES} ../sss/ex/ecc/ex_sss_ecc.c) ENDIF() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.