1 /*
2  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef SECURE_STORAGE_CLIENT_H
8 #define SECURE_STORAGE_CLIENT_H
9 
10 #include <service/secure_storage/backend/storage_backend.h>
11 #include <service/common/client/service_client.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /**
18  * @brief      Secure storage client instance
19  */
20 struct secure_storage_client
21 {
22     struct storage_backend backend;
23     struct service_client client;
24 };
25 
26 /**
27  * @brief      Initialize a secure storage client
28  *
29  * A secure storage client is a storage backend that makes RPC calls
30  * to a remote secure storage provider.
31  *
32  * @param[in]  context    Instance data
33  * @param[in]  rpc_caller RPC caller instance
34  *
35  *
36  * @return     Pointer to inialized storage backend or NULL on failure
37  */
38 struct storage_backend *secure_storage_client_init(struct secure_storage_client *context,
39 						   struct rpc_caller_session *session);
40 
41 /**
42  * @brief      Deinitialize a secure storage client
43  *
44  * @param[in]  context   Instance data
45  */
46 void secure_storage_client_deinit(struct secure_storage_client *context);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif /* SECURE_STORAGE_CLIENT_H */
53