1 /* 2 * This file is part of the openHiTLS project. 3 * 4 * openHiTLS is licensed under the Mulan PSL v2. 5 * You can use this software according to the terms and conditions of the Mulan PSL v2. 6 * You may obtain a copy of Mulan PSL v2 at: 7 * 8 * http://license.coscl.org.cn/MulanPSL2 9 * 10 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 11 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 12 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 13 * See the Mulan PSL v2 for more details. 14 */ 15 16 #ifndef CERT_CALLBACK_H 17 #define CERT_CALLBACK_H 18 19 #include "hlt_type.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /** 26 * @brief Certificate callback 27 */ 28 int32_t RegCertCallback(CertCallbackType type); 29 30 /** 31 * @brief Memory callback 32 */ 33 int32_t RegMemCallback(MemCallbackType type); 34 35 /** 36 * @brief Loading Certificates and Private Keys by hitls x509 37 */ 38 int32_t HiTLS_X509_LoadCertAndKey(HITLS_Config *tlsCfg, const char *caFile, const char *chainFile, 39 const char *eeFile, const char *signFile, const char *privateKeyFile, const char *signPrivateKeyFile); 40 41 void BinLogFixLenFunc(uint32_t logId, uint32_t logLevel, uint32_t logType, 42 void *format, void *para1, void *para2, void *para3, void *para4); 43 44 void BinLogVarLenFunc(uint32_t logId, uint32_t logLevel, uint32_t logType, 45 void *format, void *para); 46 47 void RegDefaultMemCallback(void); 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif // CERT_CALLBACK_H