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 SIGNATRUETOOLS_PROFILE_VERIFY_H
1654aa6d63Sopenharmony_ci#define SIGNATRUETOOLS_PROFILE_VERIFY_H
1754aa6d63Sopenharmony_ci
1854aa6d63Sopenharmony_ci#include "export_define.h"
1954aa6d63Sopenharmony_ci#include "profile_info.h"
2054aa6d63Sopenharmony_ci
2154aa6d63Sopenharmony_cinamespace OHOS {
2254aa6d63Sopenharmony_cinamespace SignatureTools {
2354aa6d63Sopenharmony_ci
2454aa6d63Sopenharmony_ci#define DEV_UUID_LEN 65
2554aa6d63Sopenharmony_cienum AppProvisionVerifyResult {
2654aa6d63Sopenharmony_ci    PROVISION_INVALID, // Invalid json string
2754aa6d63Sopenharmony_ci    PROVISION_OK, // Passed
2854aa6d63Sopenharmony_ci    PROVISION_UNSUPPORTED_DEVICE_TYPE, // Failed to get device id
2954aa6d63Sopenharmony_ci    PROVISION_NUM_DEVICE_EXCEEDED, // No. of device exceeds maximum number
3054aa6d63Sopenharmony_ci    PROVISION_DEVICE_UNAUTHORIZED, // Device id not included
3154aa6d63Sopenharmony_ci};
3254aa6d63Sopenharmony_ci/**
3354aa6d63Sopenharmony_ci* @brief Parse and verify the app provision
3454aa6d63Sopenharmony_ci* @param appProvision The app provision json string.
3554aa6d63Sopenharmony_ci* @param info Out param, the parsed app provision structure.
3654aa6d63Sopenharmony_ci* @return AppProvisionVerifyResult Verification result.
3754aa6d63Sopenharmony_ci*/
3854aa6d63Sopenharmony_ciDLL_EXPORT AppProvisionVerifyResult ParseAndVerify(const std::string& appProvision, ProfileInfo& info);
3954aa6d63Sopenharmony_ci/**
4054aa6d63Sopenharmony_ci* @brief Parse app provision
4154aa6d63Sopenharmony_ci* @param appProvision The app provision json string.
4254aa6d63Sopenharmony_ci* @param info Out param, the parsed app provision structure.
4354aa6d63Sopenharmony_ci* @return AppProvisionVerifyResult parse result.
4454aa6d63Sopenharmony_ci*/
4554aa6d63Sopenharmony_ciDLL_EXPORT AppProvisionVerifyResult ParseProvision(const std::string& appProvision, ProfileInfo& info);
4654aa6d63Sopenharmony_ci/**
4754aa6d63Sopenharmony_ci* @brief Parse app provision profile
4854aa6d63Sopenharmony_ci* @param appProvision The app provision json string.
4954aa6d63Sopenharmony_ci* @param info Out param, the parsed app provision structure.
5054aa6d63Sopenharmony_ci* @return AppProvisionVerifyResult parse result.
5154aa6d63Sopenharmony_ci*/
5254aa6d63Sopenharmony_ciDLL_EXPORT AppProvisionVerifyResult ParseProfile(const std::string& appProvision, ProfileInfo& info);
5354aa6d63Sopenharmony_ci} // namespace SignatureTools
5454aa6d63Sopenharmony_ci} // namespace OHOS
5554aa6d63Sopenharmony_ci#endif // SIGNATRUETOOLS_PROFILE_VERIFY_H
56