38 #ifndef _OPTIGA_CMD_H_ 39 #define _OPTIGA_CMD_H_ 78 void * caller_context);
254 #if defined (OPTIGA_CRYPT_RANDOM_ENABLED) || defined (OPTIGA_CRYPT_RSA_PRE_MASTER_SECRET_ENABLED) 285 #endif //OPTIGA_CRYPT_RANDOM_ENABLED || OPTIGA_CRYPT_RSA_PRE_MASTER_SECRET_ENABLED 287 #ifdef OPTIGA_CRYPT_HASH_ENABLED 319 #endif //OPTIGA_CRYPT_HASH_ENABLED 321 #if defined (OPTIGA_CRYPT_ECDSA_SIGN_ENABLED) || defined (OPTIGA_CRYPT_RSA_SIGN_ENABLED) 354 #endif //OPTIGA_CRYPT_ECDSA_SIGN_ENABLED || OPTIGA_CRYPT_RSA_SIGN_ENABLED 356 #if defined (OPTIGA_CRYPT_ECDSA_VERIFY_ENABLED) || defined (OPTIGA_CRYPT_RSA_VERIFY_ENABLED) 385 #endif //OPTIGA_CRYPT_ECDSA_VERIFY_ENABLED || OPTIGA_CRYPT_RSA_VERIFY_ENABLED 387 #ifdef OPTIGA_CRYPT_ECDH_ENABLED 421 #endif //OPTIGA_CRYPT_ECDH_ENABLED 423 #ifdef OPTIGA_CRYPT_TLS_PRF_SHA256_ENABLED 456 #endif //OPTIGA_CRYPT_TLS_PRF_SHA256_ENABLED 458 #if defined (OPTIGA_CRYPT_ECC_GENERATE_KEYPAIR_ENABLED) || defined (OPTIGA_CRYPT_RSA_GENERATE_KEYPAIR_ENABLED) 490 #endif //(OPTIGA_CRYPT_ECC_GENERATE_KEYPAIR_ENABLED) || (OPTIGA_CRYPT_RSA_GENERATE_KEYPAIR_ENABLED) 492 #ifdef OPTIGA_CRYPT_RSA_ENCRYPT_ENABLED 525 #endif // OPTIGA_CRYPT_RSA_ENCRYPT_ENABLED 527 #ifdef OPTIGA_CRYPT_RSA_DECRYPT_ENABLED 559 #endif // OPTIGA_CRYPT_RSA_DECRYPT_ENABLED 592 #if defined (OPTIGA_LIB_ENABLE_LOGGING) && defined (OPTIGA_LIB_ENABLE_CMD_LOGGING) 607 #define OPTIGA_CMD_LOG_MESSAGE(msg) \ 609 optiga_lib_print_message(msg,OPTIGA_COMMAND_LAYER,OPTIGA_COMMAND_LAYER_COLOR);\ 627 #define OPTIGA_CMD_LOG_HEX_DATA(array,array_len) \ 629 optiga_lib_print_array_hex_format(array,array_len,OPTIGA_UNPROTECTED_DATA_COLOR);\ 646 #define OPTIGA_CMD_LOG_STATUS(return_value) \ 648 if (OPTIGA_LIB_SUCCESS != return_value) \ 650 optiga_lib_print_status(OPTIGA_COMMAND_LAYER,OPTIGA_ERROR_COLOR,return_value); \ 654 optiga_lib_print_status(OPTIGA_COMMAND_LAYER,OPTIGA_COMMAND_LAYER_COLOR,return_value); \ 659 #define OPTIGA_CMD_LOG_MESSAGE(msg) {} 660 #define OPTIGA_CMD_LOG_HEX_DATA(array, array_len) {} 661 #define OPTIGA_CMD_LOG_STATUS(return_value) {} optiga_lib_status_t optiga_cmd_encrypt_asym(optiga_cmd_t *me, uint8_t cmd_param, optiga_encrypt_asym_params_t *params)
Encrypt data using RSA public key.
Definition: optiga_cmd.c:2775
optiga_lib_status_t optiga_cmd_calc_ssec(optiga_cmd_t *me, uint8_t cmd_param, optiga_calc_ssec_params_t *params)
Calculates shared secret.
Definition: optiga_cmd.c:2241
OPTIGA Context which holds the communication buffer, comms instance and other required....
Definition: optiga_cmd.c:288
optiga_lib_status_t optiga_cmd_get_data_object(optiga_cmd_t *me, uint8_t cmd_param, optiga_get_data_object_params_t *params)
Reads data or metadata of the specified data object.
Definition: optiga_cmd.c:1621
optiga_lib_status_t optiga_cmd_calc_sign(optiga_cmd_t *me, uint8_t cmd_param, optiga_calc_sign_params_t *params)
Calculate signature on digest.
Definition: optiga_cmd.c:1955
optiga_lib_status_t optiga_cmd_open_application(optiga_cmd_t *me, uint8_t cmd_param, void *params)
Opens the OPTIGA Application.
Definition: optiga_cmd.c:1397
optiga_lib_status_t optiga_cmd_close_application(optiga_cmd_t *me, uint8_t cmd_param, void *params)
Closes the OPTIGA Application.
Definition: optiga_cmd.c:1477
Specifies the structure for derivation of key using pseudo random function.
Definition: optiga_lib_common.h:413
optiga_lib_status_t optiga_cmd_get_random(optiga_cmd_t *me, uint8_t cmd_param, optiga_get_random_params_t *params)
Generates random data or pre-master secret for RSA key exchange.
Definition: optiga_cmd.c:1831
optiga_lib_status_t optiga_cmd_decrypt_asym(optiga_cmd_t *me, uint8_t cmd_param, optiga_decrypt_asym_params_t *params)
Decrypts data using OPTIGA RSA private key.
Definition: optiga_cmd.c:2914
optiga_lib_status_t optiga_cmd_set_data_object(optiga_cmd_t *me, uint8_t cmd_param, optiga_set_data_object_params_t *params)
Writes data or metadata to the specified data object.
Definition: optiga_cmd.c:1726
optiga_lib_status_t optiga_cmd_set_object_protected(optiga_cmd_t *me, uint8_t cmd_param, optiga_set_object_protected_params_t *params)
Writes protected object fragments to OPTIGA.
Definition: optiga_cmd.c:3208
Specifies the data structure for data to be written to OPTIGA.
Definition: optiga_lib_common.h:274
Specifies the data structure for data to be read from OPTIGA.
Definition: optiga_lib_common.h:251
optiga_cmd_t * optiga_cmd_create(uint8_t optiga_instance_id, callback_handler_t handler, void *caller_context)
Creates an instance of optiga_cmd_t.
Definition: optiga_cmd.c:1148
Specifies the data structure for generate key pair.
Definition: optiga_lib_common.h:339
optiga_lib_status_t optiga_cmd_destroy(optiga_cmd_t *me)
Destroys the instance of optiga_cmd_t.
Definition: optiga_cmd.c:1191
Specifies the data structure for ecdh secret generation.
Definition: optiga_lib_common.h:398
optiga_lib_status_t optiga_cmd_derive_key(optiga_cmd_t *me, uint8_t cmd_param, optiga_derive_key_params_t *params)
Derives a key.
Definition: optiga_cmd.c:2424
Specifies the data structure for ECDSA signature verification.
Definition: optiga_lib_common.h:377
This file provides the prototypes for the commonly used functions and structures of OPTIGA Library.
Command context.
Definition: optiga_cmd.c:331
Specifies the structure for asymmetric encryption and decryption.
Definition: optiga_lib_common.h:434
Specifies the data structure for protected update.
Definition: optiga_lib_common.h:457
Specifies the data structure of calculate hash.
Definition: optiga_lib_common.h:297
optiga_lib_status_t optiga_cmd_calc_hash(optiga_cmd_t *me, uint8_t cmd_param, optiga_calc_hash_params_t *params)
Generates hash on external data or data in OID.
Definition: optiga_cmd.c:3108
optiga_lib_status_t optiga_cmd_gen_keypair(optiga_cmd_t *me, uint8_t cmd_param, optiga_gen_keypair_params_t *params)
Generates ECC or RSA key-pair.
Definition: optiga_cmd.c:2600
Specifies the data structure for ECDSA signature.
Definition: optiga_lib_common.h:360
uint16_t optiga_lib_status_t
typedef for OPTIGA host library status
Definition: optiga_lib_types.h:97
optiga_lib_status_t optiga_cmd_release_lock(const optiga_cmd_t *me)
Releases the OPTIGA cmd lock.
Definition: optiga_cmd.c:780
void(* callback_handler_t)(void *callback_ctx, optiga_lib_status_t event)
typedef for event callback handler
Definition: optiga_lib_types.h:106
optiga_lib_status_t optiga_cmd_verify_sign(optiga_cmd_t *me, uint8_t cmd_param, optiga_verify_sign_params_t *params)
Verifies the signature over the given digest.
Definition: optiga_cmd.c:2101
Specifies the data structure of random generation.
Definition: optiga_lib_common.h:323