154aa6d63Sopenharmony_ci/*
254aa6d63Sopenharmony_ci * Copyright (c) 2024-2024 Huawei Device Co., Ltd.
354aa6d63Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
454aa6d63Sopenharmony_ci * you may not use this file except in compliance with the License.
554aa6d63Sopenharmony_ci * You may obtain a copy of the License at
654aa6d63Sopenharmony_ci *
754aa6d63Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
854aa6d63Sopenharmony_ci *
954aa6d63Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1054aa6d63Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1154aa6d63Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1254aa6d63Sopenharmony_ci * See the License for the specific language governing permissions and
1354aa6d63Sopenharmony_ci * limitations under the License.
1454aa6d63Sopenharmony_ci */
1554aa6d63Sopenharmony_ci#ifndef PROFILE_RESOURCE_H
1654aa6d63Sopenharmony_ci#define PROFILE_RESOURCE_H
1754aa6d63Sopenharmony_ci
1854aa6d63Sopenharmony_ci#include <chrono>
1954aa6d63Sopenharmony_ci#include <thread>
2054aa6d63Sopenharmony_ci#include <string>
2154aa6d63Sopenharmony_ci
2254aa6d63Sopenharmony_ci#include "options.h"
2354aa6d63Sopenharmony_ci#include "sign_tool_service_impl.h"
2454aa6d63Sopenharmony_ci#include "nlohmann/json.hpp"
2554aa6d63Sopenharmony_ci#include "signer_factory.h"
2654aa6d63Sopenharmony_ci#include "profile_sign_tool.h"
2754aa6d63Sopenharmony_ci#include "params_run_tool.h"
2854aa6d63Sopenharmony_ci#include "pkcs7_data.h"
2954aa6d63Sopenharmony_ci#include "signer_config.h"
3054aa6d63Sopenharmony_ci#include "local_signer.h"
3154aa6d63Sopenharmony_ci#include "bc_pkcs7_generator.h"
3254aa6d63Sopenharmony_ci#include "bc_signeddata_generator.h"
3354aa6d63Sopenharmony_ci#include "profile_verify.h"
3454aa6d63Sopenharmony_ci#include "constant.h"
3554aa6d63Sopenharmony_ci#include "cms_utils.h"
3654aa6d63Sopenharmony_ci
3754aa6d63Sopenharmony_ci
3854aa6d63Sopenharmony_ciusing  nlohmann::json;
3954aa6d63Sopenharmony_ci
4054aa6d63Sopenharmony_cinamespace OHOS {
4154aa6d63Sopenharmony_cinamespace SignatureTools {
4254aa6d63Sopenharmony_ci
4354aa6d63Sopenharmony_ci// sign profile使用的全局参数
4454aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_MODE = "localSign";
4554aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_KEY_ALIAS = "oh-profile1-key-v1";
4654aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_PROFILE_CERT_FILE = "./signProfile/profile-release1.pem";
4754aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_SIGN_ALG = "SHA384withECDSA";
4854aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_KEY_STORE_FILE = "./signProfile/ohtest.p12";
4954aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_OUT_FILE = "./signProfile/signed-profile.p7b";
5054aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_IN_FILE = "./signProfile/profile.json";
5154aa6d63Sopenharmony_ci
5254aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_CERT_PEM = "./signProfile/profile-release1-cert.pem";
5354aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_REVERSE_PEM = "./signProfile/profile-release1-reverse.pem";
5454aa6d63Sopenharmony_ciconst std::string SIGN_PROFILE_DOUBLE_CERT_PEM = "./signProfile/"
5554aa6d63Sopenharmony_ci"profile-release1-invalid_cert_chain.pem";
5654aa6d63Sopenharmony_ci
5754aa6d63Sopenharmony_ci// verify profile 使用的全局参数
5854aa6d63Sopenharmony_ciconst std::string VERIFY_PROFILE_IN_FILE = "./signProfile/app1-profile1.p7b";
5954aa6d63Sopenharmony_ciconst std::string VERIFY_PROFILE_OUT_FILE = "./signProfile/verify-result.json";
6054aa6d63Sopenharmony_ci}
6154aa6d63Sopenharmony_ci}
6254aa6d63Sopenharmony_ci#endif
6354aa6d63Sopenharmony_ci
64