• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef DATA_STORAGE_OPKEY_DATA_H
17 #define DATA_STORAGE_OPKEY_DATA_H
18 
19 namespace OHOS {
20 namespace Telephony {
21 class OpKeyData {
22 public:
23     /**
24      * @brief Id
25      */
26     static constexpr const char *ID = "id";
27     /**
28      * @brief Mobile country code and mobile network code
29      */
30     static constexpr const char *MCCMNC = "mccmnc";
31     /**
32      * @brief Group identifier level 1
33      */
34     static constexpr const char *GID1 = "gid1";
35     /**
36      * @brief Group identifier level 2
37      */
38     static constexpr const char *GID2 = "gid2";
39     /**
40      * @brief International mobile subscriber identity
41      */
42     static constexpr const char *IMSI = "imsi";
43     /**
44      * @brief Service provider name
45      */
46     static constexpr const char *SPN = "spn";
47     /**
48      * @brief Integrated circuit card identity
49      */
50     static constexpr const char *ICCID = "iccid";
51     /**
52      * @brief Operator name
53      */
54     static constexpr const char *OPERATOR_NAME = "operator_name";
55     /**
56      * @brief Operator key
57      */
58     static constexpr const char *OPERATOR_KEY = "operator_key";
59     /**
60      * @brief Operator nv identity
61      */
62     static constexpr const char *OPERATOR_KEY_EXT = "operator_key_ext";
63     /**
64      * @brief Represents matching rule fields
65      */
66     static constexpr const char *RULE_ID = "rule_id";
67 };
68 
69 struct OpKey {
70     int opkeyId = 0;
71     std::string mccmnc = "";
72     std::string gid1 = "";
73     std::string gid2 = "";
74     std::string imsi = "";
75     std::string spn = "";
76     std::string iccid = "";
77     std::string operatorName = "";
78     std::string operatorKey = "";
79     std::string operatorKeyExt = "";
80     int ruleId = 0;
81 };
82 
83 constexpr const char *MCCMNC_INDEX = "mccmncIndex";
84 constexpr const char *TABLE_OPKEY_INFO = "opkey_info";
85 constexpr const char *OPKEY_URI = "datashare:///com.ohos.opkeyability";
86 } // namespace Telephony
87 } // namespace OHOS
88 #endif // DATA_STORAGE_OPKEY_DATA_H