1 /* 2 * Copyright (C) 2021-2022 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 PROVISION_INFO_H 16 #define PROVISION_INFO_H 17 18 #include <string> 19 #include <vector> 20 21 namespace OHOS { 22 namespace Security { 23 namespace Verify { 24 enum ProvisionType { 25 DEBUG = 0, 26 RELEASE = 1, 27 }; 28 29 enum AppDistType { 30 NONE_TYPE = 0, 31 APP_GALLERY = 1, 32 ENTERPRISE = 2, 33 OS_INTEGRATION = 3, 34 CROWDTESTING = 4, 35 ENTERPRISE_NORMAL = 5, 36 ENTERPRISE_MDM = 6, 37 }; 38 39 struct BundleInfo { 40 std::string developerId; 41 std::string developmentCertificate; 42 std::string distributionCertificate; 43 std::string bundleName; 44 std::string apl; 45 std::string appFeature; 46 std::vector<std::string> dataGroupIds; 47 }; 48 49 struct Acls { 50 std::vector<std::string> allowedAcls; 51 }; 52 53 struct Permissions { 54 std::vector<std::string> restrictedPermissions; 55 std::vector<std::string> restrictedCapabilities; 56 }; 57 58 struct DebugInfo { 59 std::string deviceIdType; 60 std::vector<std::string> deviceIds; 61 }; 62 63 struct Validity { 64 int64_t notBefore; 65 int64_t notAfter; 66 }; 67 68 struct Metadata { 69 std::string name; 70 std::string value; 71 std::string resource; 72 }; 73 74 struct ProvisionInfo { 75 int32_t versionCode = 0; 76 std::string versionName; 77 std::string uuid; 78 ProvisionType type = DEBUG; 79 AppDistType distributionType = NONE_TYPE; 80 BundleInfo bundleInfo; 81 Acls acls; 82 Permissions permissions; 83 DebugInfo debugInfo; 84 std::string issuer; 85 std::string appId; 86 std::string fingerprint; 87 std::vector<std::string> appPrivilegeCapabilities; 88 Validity validity; 89 std::vector<Metadata> metadatas; 90 }; 91 } // namespace Verify 92 } // namespace Security 93 } // namespace OHOS 94 #endif // PROVISION_INFO_H 95