#include "optiga_util.h"
#include "optiga_crypt.h"
#include "pal_os_event.h"
#include "pal_os_event_timer.h"
#include "pal_os_timer.h"
#include "optiga_lib_logger.h"
#include "optiga_example.h"
Macros | |
#define | OPTIGA_HASH_CONTEXT_INIT(hash_context, p_context_buffer, context_buffer_size, hash_type) |
#define OPTIGA_HASH_CONTEXT_INIT | ( | hash_context, | |
p_context_buffer, | |||
context_buffer_size, | |||
hash_type | |||
) |
Prepare the hash context
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 | ) |