1/* 2 * Copyright (c) 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 HKS_API_H 17#define HKS_API_H 18 19#include "hks_type.h" 20 21namespace OHOS { 22namespace Security { 23namespace CodeSign { 24extern int g_count; 25enum HksType { 26 KEYEXIST = 1, 27 ATTESTKEY = 2, 28 GENERATEKEY = 3, 29 INIT = 4, 30 UPDATE = 5, 31 FINISH = 6, 32 ERROR = 7, 33}; 34int32_t HksKeyExist(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet); 35 36int32_t HksAttestKey(const struct HksBlob *keyAlias, 37 const struct HksParamSet *paramSet, struct HksCertChain *certChain); 38 39int32_t HksGenerateKey(const struct HksBlob *keyAlias, 40 const struct HksParamSet *paramSetIn, struct HksParamSet *paramSetOut); 41 42int32_t HksInit(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, 43 struct HksBlob *handle, struct HksBlob *token); 44 45int32_t HksUpdate(const struct HksBlob *handle, const struct HksParamSet *paramSet, 46 const struct HksBlob *inData, struct HksBlob *outData); 47 48int32_t HksFinish(const struct HksBlob *handle, const struct HksParamSet *paramSet, 49 const struct HksBlob *inData, struct HksBlob *outData); 50} 51} 52} 53 54#endif /* HKS_API_H */ 55