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 CJCFOBJECT_H 17 #define CJCFOBJECT_H 18 19 #include "cf_api.h" 20 #include "cf_result.h" 21 22 #include "cj_declare_macro.h" 23 24 #define FFI_DECLARE_CfObject(FUNC, RETURN_TYPE, ...) \ 25 FFI_DECLARE_API(CjCfObject, FUNC, RETURN_TYPE, ##__VA_ARGS__) 26 27 extern "C" { 28 typedef struct CjCfObject CjCfObject; 29 30 struct CjCfObject { 31 CfObject *cfObj; 32 }; 33 34 FFI_DECLARE_INSTANCE(CjCfObject, const CfEncodingBlob *blob); 35 FFI_DECLARE_CfObject(GetEncoded, CfResult, CfBlob *out); 36 FFI_DECLARE_CfObject(GetOidList, CfResult, int32_t valueType, CfArray *out); 37 FFI_DECLARE_CfObject(GetEntry, CfResult, int32_t valueType, CfBlob *oid, CfBlob *out); 38 FFI_DECLARE_CfObject(CheckCA, CfResult, int32_t *out); 39 FFI_DECLARE_CfObject(HasUnsupportedCriticalExtension, CfResult, bool *out); 40 } 41 42 #endif //CJCFOBJECT_H 43