1 /*
2  * Copyright (c) 2022 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 #ifndef HKS_SECURE_ACCESS_H
16 #define HKS_SECURE_ACCESS_H
17 
18 #include "hks_type.h"
19 #include "hks_keynode.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 int32_t HksCoreSecureAccessInitParams(struct HuksKeyNode *keyNode, const struct HksParamSet *initParamSet,
26     struct HksBlob *token);
27 
28 int32_t HksCoreSecureAccessVerifyParams(struct HuksKeyNode *keyNode, const struct HksParamSet *paramSet);
29 
30 int32_t HksCoreAppendAuthInfoBeforeUpdate(struct HuksKeyNode *keyNode, uint32_t pur,
31     const struct HksParamSet *inParamSet, const struct HksBlob *inData, struct HksBlob *appendedData);
32 
33 int32_t HksCoreAppendAuthInfoBeforeFinish(struct HuksKeyNode *keyNode, uint32_t pur,
34     const struct HksParamSet *inParamSet, const struct HksBlob *inData, struct HksBlob *appendedData);
35 
36 int32_t HksCoreAppendAuthInfoAfterFinish(struct HuksKeyNode *keyNode, uint32_t pur,
37     const struct HksParamSet *inParamSet, uint32_t inOutDataOriginSize, struct HksBlob *inOutData);
38 
39 int32_t HksProcessIdentityVerify(const struct HksParamSet *blobParamSet, const struct HksParamSet *runtimeParamSet);
40 
41 int32_t HksCheckKeybBlobIsSupportUserAuth(const struct HksParamSet *blobParamSet, bool *isSupport);
42 
43 int32_t CheckIfNeedIsDevicePasswordSet(const struct HksParamSet *paramSet);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif
50