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 21 namespace OHOS { 22 namespace Security { 23 namespace CodeSign { 24 int32_t HksKeyExist(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet); 25 26 int32_t HksAttestKey(const struct HksBlob *keyAlias, 27 const struct HksParamSet *paramSet, struct HksCertChain *certChain); 28 29 int32_t HksGenerateKey(const struct HksBlob *keyAlias, 30 const struct HksParamSet *paramSetIn, struct HksParamSet *paramSetOut); 31 32 int32_t HksInit(const struct HksBlob *keyAlias, const struct HksParamSet *paramSet, 33 struct HksBlob *handle, struct HksBlob *token); 34 35 int32_t HksUpdate(const struct HksBlob *handle, const struct HksParamSet *paramSet, 36 const struct HksBlob *inData, struct HksBlob *outData); 37 38 int32_t HksFinish(const struct HksBlob *handle, const struct HksParamSet *paramSet, 39 const struct HksBlob *inData, struct HksBlob *outData); 40 } 41 } 42 } 43 44 #endif /* HKS_API_H */ 45