1 /*
2  * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *    http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef HUKS_STORAGE_MANAGER_H
17 #define HUKS_STORAGE_MANAGER_H
18 
19 #include "hks_storage_utils.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 int32_t HksManageStoreKeyBlob(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
26     const struct HksBlob *keyAlias, const struct HksBlob *keyBlob, uint32_t storageType);
27 
28 int32_t HksManageStoreDeleteKeyBlob(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
29     const struct HksBlob *keyAlias, uint32_t storageType);
30 
31 int32_t HksManageStoreIsKeyBlobExist(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
32     const struct HksBlob *keyAlias, uint32_t storageType);
33 
34 int32_t HksManageStoreGetKeyBlob(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
35     const struct HksBlob *keyAlias, struct HksBlob *keyBlob, uint32_t storageType);
36 
37 int32_t HksManageStoreGetKeyBlobSize(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
38     const struct HksBlob *keyAlias, uint32_t *keyBlobSize, uint32_t storageType);
39 
40 int32_t HksManageGetKeyAliasByProcessName(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
41     struct HksKeyInfo *keyInfoList, uint32_t *listCount);
42 
43 int32_t HksManageGetKeyCountByProcessName(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
44     uint32_t *fileCount);
45 
46 int32_t HksManageListAliasesByProcessName(const struct HksProcessInfo *processInfo, const struct HksParamSet *paramSet,
47     struct HksKeyAliasSet **outData);
48 
49 int32_t HksManageStoreRenameKeyAlias(const struct HksProcessInfo *processInfo,
50     const struct HksBlob *oldKeyAlias, const struct HksParamSet *paramSet,
51     const struct HksBlob *newKeyAlias, uint32_t storageType);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif /* HUKS_STORAGE_MANAGER_H */
58