Mbed OS Reference
Loading...
Searching...
No Matches
psa_storage_common_impl.h
1/* Copyright (c) 2019 ARM Limited
2 *
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef __PSA_STORAGE_COMMON_IMPL_H__
19#define __PSA_STORAGE_COMMON_IMPL_H__
20
21#include "psa/error.h"
22#include "psa/storage_common.h"
23#include "KVStore.h"
24
25#ifdef __cplusplus
26extern "C"
27{
28#endif
29
30typedef struct {
31 uint32_t major;
32 uint32_t minor;
34
35typedef psa_status_t (*migrate_func_t)(mbed::KVStore *kvstore, const psa_storage_version_t *old_version, const psa_storage_version_t *new_version);
36
37void psa_storage_handle_version(mbed::KVStore *kvstore, const char *version_key, const psa_storage_version_t *version,
38 migrate_func_t migrate_func);
39psa_status_t psa_storage_set_impl(mbed::KVStore *kvstore, int32_t pid, psa_storage_uid_t uid, size_t data_length, const void *p_data, uint32_t kv_create_flags);
40psa_status_t psa_storage_get_impl(mbed::KVStore *kvstore, int32_t pid, psa_storage_uid_t uid, size_t data_offset, size_t data_length, void *p_data, size_t *p_data_length);
41psa_status_t psa_storage_get_info_impl(mbed::KVStore *kvstore, int32_t pid, psa_storage_uid_t uid, struct psa_storage_info_t *p_info, uint32_t *kv_get_flags);
42psa_status_t psa_storage_remove_impl(mbed::KVStore *kvstore, int32_t pid, psa_storage_uid_t uid);
43psa_status_t psa_storage_reset_impl(mbed::KVStore *kvstore);
44
45#ifdef __cplusplus
46}
47#endif
48
49
50#endif // __PSA_STORAGE_COMMON_IMPL_H__
KVStore class.
Definition: KVStore.h:38
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:55
This file includes common definitions for PSA storage.
uint64_t psa_storage_uid_t
A type for UIDs used for identifying data.
A container for metadata associated with a specific uid.