1 /*
2  * Copyright (c) 2024-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 #ifndef PROFILE_RESOURCE_H
16 #define PROFILE_RESOURCE_H
17 
18 #include <chrono>
19 #include <thread>
20 #include <string>
21 
22 #include "options.h"
23 #include "sign_tool_service_impl.h"
24 #include "nlohmann/json.hpp"
25 #include "signer_factory.h"
26 #include "profile_sign_tool.h"
27 #include "params_run_tool.h"
28 #include "pkcs7_data.h"
29 #include "signer_config.h"
30 #include "local_signer.h"
31 #include "bc_pkcs7_generator.h"
32 #include "bc_signeddata_generator.h"
33 #include "profile_verify.h"
34 #include "constant.h"
35 #include "cms_utils.h"
36 
37 
38 using  nlohmann::json;
39 
40 namespace OHOS {
41 namespace SignatureTools {
42 
43 // sign profile使用的全局参数
44 const std::string SIGN_PROFILE_MODE = "localSign";
45 const std::string SIGN_PROFILE_KEY_ALIAS = "oh-profile1-key-v1";
46 const std::string SIGN_PROFILE_PROFILE_CERT_FILE = "./signProfile/profile-release1.pem";
47 const std::string SIGN_PROFILE_SIGN_ALG = "SHA384withECDSA";
48 const std::string SIGN_PROFILE_KEY_STORE_FILE = "./signProfile/ohtest.p12";
49 const std::string SIGN_PROFILE_OUT_FILE = "./signProfile/signed-profile.p7b";
50 const std::string SIGN_PROFILE_IN_FILE = "./signProfile/profile.json";
51 
52 const std::string SIGN_PROFILE_CERT_PEM = "./signProfile/profile-release1-cert.pem";
53 const std::string SIGN_PROFILE_REVERSE_PEM = "./signProfile/profile-release1-reverse.pem";
54 const std::string SIGN_PROFILE_DOUBLE_CERT_PEM = "./signProfile/"
55 "profile-release1-invalid_cert_chain.pem";
56 
57 // verify profile 使用的全局参数
58 const std::string VERIFY_PROFILE_IN_FILE = "./signProfile/app1-profile1.p7b";
59 const std::string VERIFY_PROFILE_OUT_FILE = "./signProfile/verify-result.json";
60 }
61 }
62 #endif
63 
64