OPTIGA™ Trust M
Host Library Documentation
optiga_cmd.h
Go to the documentation of this file.
1 
38 #ifndef _OPTIGA_CMD_H_
39 #define _OPTIGA_CMD_H_
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
46 
48 typedef struct optiga_cmd optiga_cmd_t;
49 
51 typedef struct optiga_context optiga_context_t;
52 
76 optiga_cmd_t * optiga_cmd_create(uint8_t optiga_instance_id,
77  callback_handler_t handler,
78  void * caller_context);
79 
100 
101 
121 
122 
152  uint8_t cmd_param,
153  void * params);
154 
183  uint8_t cmd_param,
184  void * params);
185 
217  uint8_t cmd_param,
219 
251  uint8_t cmd_param,
253 
254 #if defined (OPTIGA_CRYPT_RANDOM_ENABLED) || defined (OPTIGA_CRYPT_RSA_PRE_MASTER_SECRET_ENABLED)
255 
283  uint8_t cmd_param,
284  optiga_get_random_params_t * params);
285 #endif //OPTIGA_CRYPT_RANDOM_ENABLED || OPTIGA_CRYPT_RSA_PRE_MASTER_SECRET_ENABLED
286 
287 #ifdef OPTIGA_CRYPT_HASH_ENABLED
288 
317  uint8_t cmd_param,
318  optiga_calc_hash_params_t * params);
319 #endif //OPTIGA_CRYPT_HASH_ENABLED
320 
321 #if defined (OPTIGA_CRYPT_ECDSA_SIGN_ENABLED) || defined (OPTIGA_CRYPT_RSA_SIGN_ENABLED)
322 
352  uint8_t cmd_param,
353  optiga_calc_sign_params_t * params);
354 #endif //OPTIGA_CRYPT_ECDSA_SIGN_ENABLED || OPTIGA_CRYPT_RSA_SIGN_ENABLED
355 
356 #if defined (OPTIGA_CRYPT_ECDSA_VERIFY_ENABLED) || defined (OPTIGA_CRYPT_RSA_VERIFY_ENABLED)
357 
383  uint8_t cmd_param,
384  optiga_verify_sign_params_t * params);
385 #endif //OPTIGA_CRYPT_ECDSA_VERIFY_ENABLED || OPTIGA_CRYPT_RSA_VERIFY_ENABLED
386 
387 #ifdef OPTIGA_CRYPT_ECDH_ENABLED
388 
419  uint8_t cmd_param,
420  optiga_calc_ssec_params_t * params);
421 #endif //OPTIGA_CRYPT_ECDH_ENABLED
422 
423 #if defined (OPTIGA_CRYPT_TLS_PRF_SHA256_ENABLED) || defined (OPTIGA_CRYPT_TLS_PRF_SHA384_ENABLED) || defined (OPTIGA_CRYPT_TLS_PRF_SHA512_ENABLED) || defined (OPTIGA_CRYPT_HKDF_ENABLED)
424 
454  uint8_t cmd_param,
455  optiga_derive_key_params_t * params);
456 #endif //OPTIGA_CRYPT_TLS_PRF_SHA256_ENABLED || OPTIGA_CRYPT_TLS_PRF_SHA384_ENABLED || OPTIGA_CRYPT_TLS_PRF_SHA512_ENABLED || OPTIGA_CRYPT_HKDF_ENABLED
457 
458 #if defined (OPTIGA_CRYPT_ECC_GENERATE_KEYPAIR_ENABLED) || defined (OPTIGA_CRYPT_RSA_GENERATE_KEYPAIR_ENABLED)
459 
488  uint8_t cmd_param,
489  optiga_gen_keypair_params_t * params);
490 #endif //(OPTIGA_CRYPT_ECC_GENERATE_KEYPAIR_ENABLED) || (OPTIGA_CRYPT_RSA_GENERATE_KEYPAIR_ENABLED)
491 
492 #ifdef OPTIGA_CRYPT_RSA_ENCRYPT_ENABLED
493 
523  uint8_t cmd_param,
525 #endif // OPTIGA_CRYPT_RSA_ENCRYPT_ENABLED
526 
527 #ifdef OPTIGA_CRYPT_RSA_DECRYPT_ENABLED
528 
557  uint8_t cmd_param,
559 #endif // OPTIGA_CRYPT_RSA_DECRYPT_ENABLED
560 
589  uint8_t cmd_param,
591 
592 #if defined (OPTIGA_CRYPT_SYM_ENCRYPT_ENABLED) || defined (OPTIGA_CRYPT_HMAC_ENABLED)
593 
622  uint8_t cmd_param,
623  optiga_encrypt_sym_params_t * params);
624 #endif
625 
626 #if defined (OPTIGA_CRYPT_SYM_DECRYPT_ENABLED) || defined (OPTIGA_CRYPT_HMAC_VERIFY_ENABLED) ||\
627  defined (OPTIGA_CRYPT_CLEAR_AUTO_STATE_ENABLED)
628 
657  uint8_t cmd_param,
658  optiga_decrypt_sym_params_t * params);
659 #endif
660 
661 #ifdef OPTIGA_CRYPT_SYM_GENERATE_KEY_ENABLED
662 
691  uint8_t cmd_param,
692  optiga_gen_symkey_params_t * params);
693 #endif // OPTIGA_CRYPT_SYM_GENERATE_KEY_ENABLED
694 
695 #ifdef __cplusplus
696 }
697 #endif
698 
699 #endif /*_OPTIGA_CMD_H_ */
700 
optiga_calc_ssec
Specifies the data structure for ecdh secret generation.
Definition: optiga_lib_common.h:505
optiga_symmetric_enc_dec_params
Specifies the data structure for symmetric encrypt and decrypt.
Definition: optiga_lib_common.h:584
optiga_cmd_t
struct optiga_cmd optiga_cmd_t
OPTIGA command instance structure type.
Definition: optiga_cmd.h:48
optiga_cmd_set_data_object
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.
optiga_cmd_create
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.
optiga_cmd_get_random
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.
optiga_set_data_object
Specifies the data structure for data to be written to OPTIGA.
Definition: optiga_lib_common.h:379
optiga_get_data_object
Specifies the data structure for data to be read from OPTIGA.
Definition: optiga_lib_common.h:356
optiga_cmd_get_data_object
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.
optiga_cmd_calc_sign
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.
optiga_cmd_verify_sign
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.
optiga_get_random
Specifies the data structure of random generation.
Definition: optiga_lib_common.h:428
optiga_cmd_derive_key
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.
optiga_cmd_gen_symkey
optiga_lib_status_t optiga_cmd_gen_symkey(optiga_cmd_t *me, uint8_t cmd_param, optiga_gen_symkey_params_t *params)
Generate symmetric key using OPTIGA.
optiga_gen_symkey_params
Specifies the data structure for symmetric generate key.
Definition: optiga_lib_common.h:628
optiga_cmd_open_application
optiga_lib_status_t optiga_cmd_open_application(optiga_cmd_t *me, uint8_t cmd_param, void *params)
Opens the OPTIGA Application.
optiga_cmd_gen_keypair
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.
optiga_cmd_set_object_protected
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.
optiga_calc_hash
Specifies the data structure of calculate hash.
Definition: optiga_lib_common.h:402
optiga_cmd_release_lock
optiga_lib_status_t optiga_cmd_release_lock(const optiga_cmd_t *me)
Releases the OPTIGA cmd lock.
optiga_cmd_destroy
optiga_lib_status_t optiga_cmd_destroy(optiga_cmd_t *me)
Destroys the instance of optiga_cmd_t.
optiga_cmd_encrypt_asym
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.
optiga_verify_sign
Specifies the data structure for ECDSA signature verification.
Definition: optiga_lib_common.h:484
optiga_cmd_close_application
optiga_lib_status_t optiga_cmd_close_application(optiga_cmd_t *me, uint8_t cmd_param, void *params)
Closes the OPTIGA Application.
optiga_cmd_decrypt_asym
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.
optiga_cmd_decrypt_sym
optiga_lib_status_t optiga_cmd_decrypt_sym(optiga_cmd_t *me, uint8_t cmd_param, optiga_decrypt_sym_params_t *params)
Decrypt data using optiga_symmetric_encryption_mode_t encryption scheme.
optiga_cmd_calc_hash
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.
optiga_enc_dec_asym
Specifies the structure for asymmetric encryption and decryption.
Definition: optiga_lib_common.h:546
optiga_set_object_protected_params
Specifies the data structure for protected update.
Definition: optiga_lib_common.h:568
optiga_calc_sign
Specifies the data structure for ECDSA signature.
Definition: optiga_lib_common.h:467
optiga_lib_common.h
This file provides the prototypes for the commonly used functions and structures of OPTIGA Library.
optiga_gen_keypair
Specifies the data structure for generate key pair.
Definition: optiga_lib_common.h:446
optiga_context_t
struct optiga_context optiga_context_t
OPTIGA comms instance structure type.
Definition: optiga_cmd.h:51
callback_handler_t
void(* callback_handler_t)(void *callback_ctx, optiga_lib_status_t event)
typedef for event callback handler
Definition: optiga_lib_types.h:99
optiga_lib_status_t
uint16_t optiga_lib_status_t
typedef for OPTIGA host library status
Definition: optiga_lib_types.h:90
optiga_cmd_encrypt_sym
optiga_lib_status_t optiga_cmd_encrypt_sym(optiga_cmd_t *me, uint8_t cmd_param, optiga_encrypt_sym_params_t *params)
Encrypt data using optiga_symmetric_encryption_mode_t encryption scheme.
optiga_cmd_calc_ssec
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.
optiga_derive_key
Specifies the structure for derivation of key using pseudo random function.
Definition: optiga_lib_common.h:520