This file defines APIs, types and data structures used in the OPTIGA example. More...
Go to the source code of this file.
This file defines APIs, types and data structures used in the OPTIGA example.
Copyright (c) 2019 Infineon Technologies AG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
\endcopyright
#define OPTIGA_EXAMPLE "[optiga example] : " |
#define OPTIGA_EXAMPLE_COLOR OPTIGA_LIB_LOGGER_COLOR_DEFAULT |
#define OPTIGA_EXAMPLE_LOG_HEX_DATA | ( | array, | |
array_len | |||
) |
Logs the byte array buffer provided from Application layer in hexadecimal format.
Logs the byte array buffer provided from Application layer in hexadecimal format
[in] | array | Valid pointer to array to be logged |
[in] | array_len | Length of array buffer |
#define OPTIGA_EXAMPLE_LOG_MESSAGE | ( | msg | ) |
Logs the message provided from Application layer.
Logs the message provided from Application layer
[in] | msg | Valid pointer to string to be logged |
#define OPTIGA_EXAMPLE_LOG_STATUS | ( | return_value | ) |
Logs the status info provided from Application layer.
Logs the status info provided from Application layer
[in] | return_value | Status information Application layer |
#define OPTIGA_LIB_ENABLE_EXAMPLE_LOGGING |
void example_optiga_crypt_ecc_generate_keypair | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_ecdh | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_ecdsa_sign | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_ecdsa_verify | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_hash | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_random | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_rsa_decrypt_and_export | ( | void | ) |
void example_optiga_crypt_rsa_decrypt_and_store | ( | void | ) |
void example_optiga_crypt_rsa_encrypt_message | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_rsa_encrypt_session | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_rsa_generate_keypair | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_rsa_sign | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_rsa_verify | ( | void | ) |
Create OPTIGA Util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_crypt_tls_prf_sha256 | ( | void | ) |
Default metadata
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA using optiga_util_close_application
void example_optiga_util_hibernate_restore | ( | void | ) |
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
To perform the hibernate, Security Event Counter(SEC) must be 0. Read SEC data object (0xE0C5) and wait until SEC = 0
Hibernate the application on OPTIGA using optiga_util_close_application with perform_hibernate parameter as true
Restore the application on OPTIGA using optiga_util_open_application with perform_restore parameter as true
Close the application on OPTIGA without hibernating using optiga_util_close_application
void example_optiga_util_protected_update | ( | void | ) |
Manifest for ECC-256
Fragment array for continue with 608 bytes of payload and 32 bytes of digest of next fragment
Fragment array for final with 50 bytes of payload
Sample metadata of 0xE0E1 to change access condition to integrity protected and reseting the version tag
Sample metadata of 0xE0E3 for execute access condition
Create OPTIGA util Instance
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Precondition 1 : Write Metadata for 0xE0E1 and 0xE0E3
Precondition 2 : Write ECC-256 certificate for 0xE0E3
Send the manifest using optiga_util_protected_update_start
Send the first fragment using optiga_util_protected_update_continue
Send the last fragment using optiga_util_protected_update_final
Close the application on OPTIGA without hibernating using optiga_util_close_application
void example_optiga_util_read_data | ( | void | ) |
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Read metadata of a data object (e.g. certificate data object E0E0) using optiga_util_read_data.
Close the application on OPTIGA without hibernating using optiga_util_close_application
void example_optiga_util_read_uuid | ( | void | ) |
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Close the application on OPTIGA without hibernating using optiga_util_close_application
void example_optiga_util_update_count | ( | void | ) |
Initialize the counter object with a threshold value 0x0A
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Pre-condition Any data object can be converted to counter data object by changing metadata as mentioned below:
Write default count and threshold value to counter data object (e.g. E120) using optiga_util_write_data.
Use Erase and Write (OPTIGA_UTIL_ERASE_AND_WRITE) option, in order to correctly update the used length of the object.
Close the application on OPTIGA without hibernating using optiga_util_close_application
void example_optiga_util_write_data | ( | void | ) |
Sample metadata
Open the application on OPTIGA which is a precondition to perform any other operations using optiga_util_open_application
Write Trust Anchor to a Trust Anchor object (e.g. E0E8) using optiga_util_write_data with no shielded connection protection.
Use Erase and Write (OPTIGA_UTIL_ERASE_AND_WRITE) option, to clear the remaining data in the object
Write metadata to Trust Anchor to a Trust Anchor object (e.g. E0E8) using optiga_util_write_metadata.
Sample metadata: write "Read" access condition as LcsO < Operational
Close the application on OPTIGA without hibernating using optiga_util_close_application
void example_pair_host_and_optiga_using_pre_shared_secret | ( | void | ) |