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 CODE_SIGN_JIT_SIGN_CODE_H
17 #define CODE_SIGN_JIT_SIGN_CODE_H
18 
19 #include "jit_code_signer_base.h"
20 
21 namespace panda::ecmascript::kungfu {
22 using namespace OHOS::Security::CodeSign;
23 
24 
25 class JitSignCode {
26 public:
27     ~JitSignCode() = default;
28 
GetInstance()29     static JitSignCode *GetInstance()
30     {
31         static JitSignCode instance;
32         return &instance;
33     }
34 
35     void SetCodeSigner(JitCodeSignerBase *p);
36     JitCodeSignerBase *GetCodeSigner();
37     void SetKind(int kind);
38     int GetKind();
39     void Reset();
40     int signTableSize_ = -1;
41 private:
42     JitSignCode();
43     int kind_ = -1;
44     JitCodeSignerBase *codeSigner_ {nullptr};
45 };
46 
47 } // namespace panda::ecmascript::kungfu
48 #endif
49