-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathstruct.go
101 lines (89 loc) · 3.3 KB
/
struct.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package main
import (
_ "embed"
"encoding/json"
"strings"
)
type PullInfo struct {
SMDP string
MatchID string
ObjectID string
ConfirmCode string
IMEI string
}
type LpacReturnValue struct {
Type string `json:"type"`
Payload struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data"`
} `json:"payload"`
}
type EuiccInfo struct {
EidValue string `json:"eidValue"`
EuiccConfiguredAddresses struct {
DefaultDpAddress any `json:"defaultDpAddress"`
RootDsAddress string `json:"rootDsAddress"`
} `json:"EuiccConfiguredAddresses"`
EUICCInfo2 struct {
ProfileVersion string `json:"profileVersion"`
Svn string `json:"svn"`
EuiccFirmwareVer string `json:"euiccFirmwareVer"`
ExtCardResource struct {
InstalledApplication int `json:"installedApplication"`
FreeNonVolatileMemory int `json:"freeNonVolatileMemory"`
FreeVolatileMemory int `json:"freeVolatileMemory"`
} `json:"extCardResource"`
UiccCapability []string `json:"uiccCapability"`
JavacardVersion string `json:"javacardVersion"`
GlobalplatformVersion string `json:"globalplatformVersion"`
RspCapability []string `json:"rspCapability"`
EuiccCiPKIDListForVerification []string `json:"euiccCiPKIdListForVerification"`
EuiccCiPKIDListForSigning []string `json:"euiccCiPKIdListForSigning"`
EuiccCategory any `json:"euiccCategory"`
ForbiddenProfilePolicyRules []string `json:"forbiddenProfilePolicyRules"`
PpVersion string `json:"ppVersion"`
SasAcreditationNumber string `json:"sasAcreditationNumber"`
CertificationDataObject struct {
PlatformLabel string `json:"platformLabel"`
DiscoveryBaseURL string `json:"discoveryBaseURL"`
} `json:"certificationDataObject"`
} `json:"EUICCInfo2"`
}
type Profile struct {
Iccid string `json:"iccid"`
IsdpAid string `json:"isdpAid"`
ProfileState string `json:"profileState"`
ProfileNickname *string `json:"profileNickname"`
ServiceProviderName string `json:"serviceProviderName"`
ProfileName string `json:"profileName"`
IconType string `json:"iconType"`
Icon []byte `json:"icon"`
ProfileClass string `json:"profileClass"`
}
func (p *Profile) MaskedICCID() string {
return p.Iccid[0:7] + strings.Repeat("*", len(p.Iccid)-7)
}
func (p *Profile) CapitalizedState() string {
return strings.ToUpper(p.ProfileState[0:1]) + p.ProfileState[1:]
}
type Notification struct {
SeqNumber int `json:"seqNumber"`
ProfileManagementOperation string `json:"profileManagementOperation"`
NotificationAddress string `json:"notificationAddress"`
Iccid string `json:"iccid"`
}
func (n *Notification) MaskedICCID() string {
return n.Iccid[0:7] + strings.Repeat("*", len(n.Iccid)-7)
}
func (n *Notification) CapitalizedOperation() string {
return strings.ToUpper(n.ProfileManagementOperation[0:1]) + n.ProfileManagementOperation[1:]
}
type ApduDriver struct {
Env string `json:"env"`
Name string `json:"name"`
}
var Profiles []*Profile
var Notifications []*Notification
var ChipInfo *EuiccInfo
var ApduDrivers []*ApduDriver