Jamie Fox | 598f6d4 | 2019-07-01 17:56:37 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2019, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /** This file describes the PSA Internal Trusted Storage API |
| 9 | */ |
| 10 | |
| 11 | #ifndef PSA_INTERNAL_TRUSTED_STORAGE_H |
| 12 | #define PSA_INTERNAL_TRUSTED_STORAGE_H |
| 13 | |
| 14 | #include <stddef.h> |
| 15 | #include <stdint.h> |
| 16 | |
| 17 | #include "psa/error.h" |
| 18 | #include "psa/storage_common.h" |
| 19 | |
| 20 | #ifdef __cplusplus |
| 21 | extern "C" { |
| 22 | #endif |
| 23 | #define PSA_ITS_API_VERSION_MAJOR 1 |
| 24 | #define PSA_ITS_API_VERSION_MINOR 0 |
| 25 | |
| 26 | // This version of the header file is associated with 1.0 final release. |
| 27 | |
| 28 | /** |
| 29 | * Create a new or modify an existing uid/value pair |
| 30 | */ |
| 31 | psa_status_t psa_its_set(psa_storage_uid_t uid, |
| 32 | size_t data_length, |
| 33 | const void *p_data, |
| 34 | psa_storage_create_flags_t create_flags); |
| 35 | |
| 36 | /** |
| 37 | * Retrieve data associated with a provided UID |
| 38 | */ |
| 39 | psa_status_t psa_its_get(psa_storage_uid_t uid, |
| 40 | size_t data_offset, |
| 41 | size_t data_size, |
| 42 | void *p_data, |
| 43 | size_t *p_data_length); |
| 44 | |
| 45 | /** |
| 46 | * Retrieve the metadata about the provided uid |
| 47 | */ |
| 48 | psa_status_t psa_its_get_info(psa_storage_uid_t uid, |
| 49 | struct psa_storage_info_t *p_info); |
| 50 | |
| 51 | /** |
| 52 | * Remove the provided key and its associated data from the storage |
| 53 | */ |
| 54 | psa_status_t psa_its_remove(psa_storage_uid_t uid); |
| 55 | |
| 56 | #ifdef __cplusplus |
| 57 | } |
| 58 | #endif |
| 59 | |
| 60 | #endif // PSA_INTERNAL_TRUSTED_STORAGE_H |