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 16 #ifndef NAPI_X509_CRL_ENTRY_H 17 #define NAPI_X509_CRL_ENTRY_H 18 19 #include <string> 20 21 #include "napi/native_api.h" 22 #include "napi/native_common.h" 23 #include "x509_crl_entry.h" 24 25 namespace OHOS { 26 namespace CryptoFramework { 27 class NapiX509CrlEntry { 28 public: 29 explicit NapiX509CrlEntry(HcfX509CrlEntry *x509CrlEntry); 30 ~NapiX509CrlEntry(); 31 32 static void DefineX509CrlEntryJSClass(napi_env env); 33 static napi_value CreateX509CrlEntry(napi_env env); 34 35 napi_value GetEncoded(napi_env env, napi_callback_info info); 36 napi_value GetSerialNumber(napi_env env, napi_callback_info info); 37 napi_value GetCertificateIssuer(napi_env env, napi_callback_info info); 38 napi_value GetRevocationDate(napi_env env, napi_callback_info info); 39 napi_value GetExtensionValue(napi_env env, napi_callback_info info); 40 GetX509CrlEntry()41 HcfX509CrlEntry *GetX509CrlEntry() 42 { 43 return x509CrlEntry_; 44 } 45 46 static thread_local napi_ref classRef_; 47 48 private: 49 HcfX509CrlEntry *x509CrlEntry_ = nullptr; 50 }; 51 } // namespace CryptoFramework 52 } // namespace OHOS 53 54 #endif // NAPI_X509_CRL_ENTRY_H 55