1 /*
2  * Copyright (C) 2023 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 APP_DOMAIN_VERIFIER_H
16 #define APP_DOMAIN_VERIFIER_H
17 
18 #include "http_client.h"
19 #include "inner_verify_status.h"
20 #include "app_verify_base_info.h"
21 #include "asset_json_obj.h"
22 #include "skill_uri.h"
23 
24 namespace OHOS {
25 namespace AppDomainVerify {
26 class DomainVerifier {
27 public:
28     static InnerVerifyStatus VerifyHost(OHOS::NetStack::HttpClient::ResponseCode responseCode,
29         const std::string &assetJsonsStr, const AppVerifyBaseInfo &appVerifyBaseInfo);
30 
31 private:
32     static InnerVerifyStatus GetVerifyStatusFromHttpError(OHOS::NetStack::HttpClient::ResponseCode responseCode);
33     static InnerVerifyStatus VerifyHostWithAppIdentifier(const AssetJsonObj &assetJsonObj,
34         const AppVerifyBaseInfo &appVerifyBaseInfo);
35     static InnerVerifyStatus VerifyHostWithBundleName(const AssetJsonObj &assetJsonObj,
36         const AppVerifyBaseInfo &appVerifyBaseInfo);
37 };
38 }
39 }
40 #endif