|
Tizen HAL API
1.0
|
The Keys provides functions to handle keys and data related operations.
#include <hal/hal-security-keys.h>
The Security Keys provides functions to handle keys and data related operations
The Security Keys functions provide methods to:
For more information on the Security Keys features and the macros, see HAL Security programming guides and tutorials.
Typedefs | |
| typedef struct _hal_backend_security_keys_funcs | hal_backend_security_keys_funcs |
| Structure for security keys functions. | |
| typedef size_t | hal_security_keys_cipher_context_t |
| Type for cipher context. | |
| struct _hal_backend_security_keys_funcs |
Structure for security keys functions.
| int(* _hal_backend_security_keys_funcs::cipher_add_aad)(const hal_security_keys_context_s context, const hal_security_keys_cipher_context_t cipher_context, const hal_security_keys_data_s aad) |
Add AAD
| int(* _hal_backend_security_keys_funcs::cipher_finalize)(const hal_security_keys_context_s context, const hal_security_keys_cipher_context_t cipher_context, const hal_security_keys_data_s data, hal_security_keys_data_s *out) |
Finalize cipher
| int(* _hal_backend_security_keys_funcs::cipher_free)(const hal_security_keys_context_s context, const hal_security_keys_cipher_context_t cipher_context) |
Cleanup cipher
| int(* _hal_backend_security_keys_funcs::cipher_initialize)(const hal_security_keys_context_s context, const bool encrypt, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_tag_s key_pwd, const hal_security_keys_data_s iv, const hal_security_keys_data_s aad, const size_t tag_size_bits, hal_security_keys_cipher_context_t *cipher_context) |
Initialize cipher
| int(* _hal_backend_security_keys_funcs::cipher_update)(const hal_security_keys_context_s context, const hal_security_keys_cipher_context_t cipher_context, const hal_security_keys_data_s data, hal_security_keys_data_s *out) |
Update cipher
Free HAL backend context
Initialize HAL backend context
| int(* _hal_backend_security_keys_funcs::create_iv)(const hal_security_keys_context_s context, hal_security_keys_data_s *iv) |
Create initialization vector
| int(* _hal_backend_security_keys_funcs::create_key_aes)(const hal_security_keys_context_s context, const size_t key_size_bits, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_s key_pwd, hal_security_keys_data_s *key_tag) |
Create AES key
| int(* _hal_backend_security_keys_funcs::create_key_dbp)(const bool destroy_old) |
Create DBP key
| int(* _hal_backend_security_keys_funcs::create_key_pair_dsa)(const hal_security_keys_context_s context, const size_t key_size_bits, const hal_security_keys_data_s prime, const hal_security_keys_data_s subprime, const hal_security_keys_data_s base, const hal_security_keys_data_s priv_key_id, const hal_security_keys_password_iv_s priv_key_pwd, const hal_security_keys_data_s pub_key_id, const hal_security_keys_password_iv_s pub_key_pwd, hal_security_keys_data_s *priv_key_tag, hal_security_keys_data_s *pub_key_tag) |
Create DSA key pair
| int(* _hal_backend_security_keys_funcs::create_key_pair_ecdsa)(const hal_security_keys_context_s context, const hal_security_keys_ec_type_e ec_type, const hal_security_keys_data_s priv_key_id, const hal_security_keys_password_iv_s priv_key_pwd, const hal_security_keys_data_s pub_key_id, const hal_security_keys_password_iv_s pub_key_pwd, hal_security_keys_data_s *priv_key_tag, hal_security_keys_data_s *pub_key_tag) |
Create ECDSA key pair
| int(* _hal_backend_security_keys_funcs::create_key_pair_kem)(const hal_security_keys_context_s context, const hal_security_keys_kem_type_e kem_type, const hal_security_keys_data_s priv_key_id, const hal_security_keys_password_iv_s priv_key_pwd, const hal_security_keys_data_s pub_key_id, const hal_security_keys_password_iv_s pub_key_pwd, hal_security_keys_data_s *priv_key_tag, hal_security_keys_data_s *pub_key_tag) |
Create KEM key pair
| int(* _hal_backend_security_keys_funcs::create_key_pair_rsa)(const hal_security_keys_context_s context, const size_t key_size_bits, const hal_security_keys_data_s priv_key_id, const hal_security_keys_password_iv_s priv_key_pwd, const hal_security_keys_data_s pub_key_id, const hal_security_keys_password_iv_s pub_key_pwd, hal_security_keys_data_s *priv_key_tag, hal_security_keys_data_s *pub_key_tag) |
Create RSA key pair
| int(* _hal_backend_security_keys_funcs::create_signature)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_data_s priv_key_id, const hal_security_keys_password_iv_tag_s priv_key_pwd, const hal_security_keys_data_s message, hal_security_keys_data_s *signature) |
Create signature
| int(* _hal_backend_security_keys_funcs::decapsulate_key)(const hal_security_keys_context_s context, const hal_security_keys_kem_type_e kem_type, const hal_security_keys_data_s priv_key_id, const hal_security_keys_password_iv_tag_s priv_key_pwd, const hal_security_keys_data_s shared_secret_id, const hal_security_keys_password_iv_s shared_secret_pwd, const hal_security_keys_data_s ciphertext, hal_security_keys_data_s *shared_secret_tag) |
Decapsulate key
| int(* _hal_backend_security_keys_funcs::decrypt_data)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_padding_algorithm_e padding, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_tag_s key_pwd, const hal_security_keys_data_s data, const hal_security_keys_data_s iv, hal_security_keys_data_s *out) |
Decrypt data
| int(* _hal_backend_security_keys_funcs::decrypt_data_auth)(const hal_security_keys_context_s context, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_tag_s key_pwd, const hal_security_keys_data_s data, const hal_security_keys_data_s iv, const hal_security_keys_data_s aad, const size_t tag_size_bits, const hal_security_keys_data_s tag, hal_security_keys_data_s *out) |
Authenticated data decryption
| int(* _hal_backend_security_keys_funcs::derive_ecdh)(const hal_security_keys_context_s context, const hal_security_keys_ec_type_e ec_type, const hal_security_keys_data_s pub_key_x, const hal_security_keys_data_s pub_key_y, const hal_security_keys_data_s priv_key_id, const hal_security_keys_password_iv_tag_s priv_key_pwd, const hal_security_keys_data_s secret_id, const hal_security_keys_password_iv_s secret_pwd, hal_security_keys_data_s *secret_tag) |
Derive ECDH
| int(* _hal_backend_security_keys_funcs::derive_hybrid_kbkdf)(const hal_security_keys_context_s context, const hal_security_keys_kbkdf_params_s params, const hal_security_keys_data_s first_secret_id, const hal_security_keys_password_iv_tag_s first_secret_pwd, const hal_security_keys_data_s second_secret_id, const hal_security_keys_password_iv_tag_s second_secret_pwd, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_s key_pwd, hal_security_keys_data_s *key_tag) |
Derive hybrid KBKDF
| int(* _hal_backend_security_keys_funcs::derive_kbkdf)(const hal_security_keys_context_s context, const hal_security_keys_kbkdf_params_s params, const hal_security_keys_data_s secret_id, const hal_security_keys_password_iv_tag_s secret_pwd, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_s key_pwd, hal_security_keys_data_s *key_tag) |
Derive KBKDF
| int(* _hal_backend_security_keys_funcs::destroy_data)(const hal_security_keys_context_s context, const hal_security_keys_data_s data_id) |
Destroy data
| int(* _hal_backend_security_keys_funcs::destroy_key)(const hal_security_keys_context_s context, const hal_security_keys_data_s key_id) |
Destroy key
| int(* _hal_backend_security_keys_funcs::encapsulate_key)(const hal_security_keys_context_s context, const hal_security_keys_kem_type_e kem_type, const hal_security_keys_data_s pub_key_id, const hal_security_keys_password_iv_tag_s pub_key_pwd, const hal_security_keys_data_s shared_secret_id, const hal_security_keys_password_iv_s shared_secret_pwd, hal_security_keys_data_s *ciphertext, hal_security_keys_data_s *shared_secret_tag) |
Encapsulate key
| int(* _hal_backend_security_keys_funcs::encrypt_data)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_padding_algorithm_e padding, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_tag_s key_pwd, const hal_security_keys_data_s data, const hal_security_keys_data_s iv, hal_security_keys_data_s *out) |
Encrypt data
| int(* _hal_backend_security_keys_funcs::encrypt_data_auth)(const hal_security_keys_context_s context, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_tag_s key_pwd, const hal_security_keys_data_s data, const hal_security_keys_data_s iv, const hal_security_keys_data_s aad, const size_t tag_size_bits, hal_security_keys_data_s *tag, hal_security_keys_data_s *out) |
Authenticated data encryption
| int(* _hal_backend_security_keys_funcs::encrypt_data_dbp)(const hal_security_keys_dbp_scheme_version_e dbp_scheme_version, const hal_security_keys_data_s data, const hal_security_keys_data_s iv, hal_security_keys_data_s *out) |
Encrypt data with DBP key
| int(* _hal_backend_security_keys_funcs::export_data)(const hal_security_keys_context_s context, const hal_security_keys_data_s data_id, const hal_security_keys_password_iv_tag_s data_pwd, const hal_security_keys_data_type_e data_type, hal_security_keys_data_s *data) |
Export data
| int(* _hal_backend_security_keys_funcs::export_wrapped_key)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_data_s iv, const hal_security_keys_data_s aad, const size_t ctr_len_or_tag_size_bits, const hal_security_keys_data_s wrapping_key_id, const hal_security_keys_password_iv_tag_s wrapping_key_pwd, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_tag_s key_pwd, const hal_security_keys_data_type_e key_type, hal_security_keys_data_s *wrapped_key) |
Export wrapped key
| int(* _hal_backend_security_keys_funcs::get_max_chunk_size)(const hal_security_keys_context_s context, size_t *chunk_size) |
Get max chunk size
| int(* _hal_backend_security_keys_funcs::import_data)(const hal_security_keys_context_s context, const hal_security_keys_data_s data_id, const hal_security_keys_password_iv_s data_pwd, const hal_security_keys_data_type_e data_type, const hal_security_keys_data_s data, const hal_security_keys_data_s data_encryption_iv, const hal_security_keys_data_s data_encryption_tag, hal_security_keys_data_s *data_tag) |
Import data
| int(* _hal_backend_security_keys_funcs::import_wrapped_key)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_data_s iv, const hal_security_keys_data_s aad, const size_t ctr_len_or_tag_size_bits, const hal_security_keys_data_s wrapping_key_id, const hal_security_keys_password_iv_tag_s wrapping_key_pwd, const hal_security_keys_data_s wrapped_key, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_s key_pwd, const hal_security_keys_data_type_e key_type, hal_security_keys_data_s *key_tag) |
Import wrapped key
| bool(* _hal_backend_security_keys_funcs::is_se_supported)(void) |
Check if SE backend is supported
| bool(* _hal_backend_security_keys_funcs::is_tz_supported)(void) |
Check if TZ backend is supported
| int(* _hal_backend_security_keys_funcs::unwrap_concatenated_data)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_data_s wrapping_key_id, const hal_security_keys_password_iv_tag_s wrapping_key_pwd, const hal_security_keys_data_s wrapped_key, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_s key_pwd, const hal_security_keys_data_type_e key_type, const size_t key_size_bits, hal_security_keys_data_s *data, hal_security_keys_data_s *key_tag) |
Unwrap concatenated data
| int(* _hal_backend_security_keys_funcs::verify_signature)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_data_s pub_key_id, const hal_security_keys_password_iv_tag_s pub_key_pwd, const hal_security_keys_data_s message, const hal_security_keys_data_s signature) |
Verify signature
| int(* _hal_backend_security_keys_funcs::wrap_concatenated_data)(const hal_security_keys_context_s context, const hal_security_keys_algo_type_e algo, const hal_security_keys_hash_algorithm_e hash, const hal_security_keys_data_s wrapping_key_id, const hal_security_keys_password_iv_tag_s wrapping_key_pwd, const hal_security_keys_data_s key_id, const hal_security_keys_password_iv_tag_s key_pwd, const hal_security_keys_data_s data, hal_security_keys_data_s *wrapped_key) |
Wrap concatenated data
| struct hal_security_keys_context_s |
| struct hal_security_keys_data_s |
Structure for binary data exchange.
Data Fields | |
| unsigned char * | buffer |
| size_t | length |
| unsigned char* hal_security_keys_data_s::buffer |
Binary data buffer
Binary data length
| struct hal_security_keys_password_iv_s |
Structure for password and iv params exchange.
Data Fields | |
| hal_security_keys_data_s | password |
| hal_security_keys_data_s | iv |
Initialization vector buffer
Password buffer
| struct hal_security_keys_password_iv_tag_s |
Structure for password, iv and tag params exchange.
Data Fields | |
| hal_security_keys_data_s | password |
| hal_security_keys_data_s | iv |
| hal_security_keys_data_s | tag |
Initialization vector buffer
| struct hal_security_keys_kbkdf_params_s |
Structure for KBKDF params exchange.
Information related to the derived key
KBKDF fixed input replacing context and label
Purpose for the derived key
Length of the derived key in bytes
Specifies the extent of the length suffix representation in bits
Specifies location of the counter
Skip the zero octet separator between label and context
Pseudo-random function
Specifies the length of the counter representation in bits
| typedef struct _hal_backend_security_keys_funcs hal_backend_security_keys_funcs |
Structure for security keys functions.
| typedef size_t hal_security_keys_cipher_context_t |
Type for cipher context.
Enumeration for algorithm type.
Enumeration for data type.
Enumeration for security keys errors.
Enumeration for hash algorithm.
Enumeration for padding algorithm.