lpac

package
v1.0.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandStdioAPDU     = "apdu"
	CommandStdioLPA      = "lpa"
	CommandStdioProgress = "progress"

	CommandAPDUFuncConnect         = "connect"
	CommandAPDUFuncDisconnect      = "disconnect"
	CommandAPDUOpenLogicalChannel  = "logic_channel_open"
	CommandAPDUCloseLogicalChannel = "logic_channel_close"
	CommandAPDUFuncTransmit        = "transmit"
)
View Source
const (
	NotificationProfileManagementOperationDisable = "disable"
	NotificationProfileManagementOperationEnable  = "enable"
	NotificationProfileManagementOperationInstall = "install"
	NotificationProfileManagementOperationDelete  = "delete"
)
View Source
const (
	ErrDeletionNotificationNotFound = "deletion notification not found"
)
View Source
const (
	GitHubAPI = "https://api.github.com/repos/estkme-group/lpac/releases"
)

Variables

View Source
var ProgressMessages = map[string]string{
	"es10b_get_euicc_challenge_and_info":   "Getting euicc challenge and info",
	"es10b_retrieve_notifications_list":    "Retrieving notifications list",
	"es10b_authenticate_server":            "Authenticating server",
	"es10a_get_euicc_configured_addresses": "Getting euicc configured addresses",
	"es10b_get_euicc_info":                 "Getting euicc info",
	"es9p_initiate_authentication":         "Initiating authentication",
	"es9p_authenticate_client":             "Authenticating client",
	"es9p_handle_notification":             "Handling notification",
	"es9p_get_bound_profile_package":       "Getting bound profile package",
	"es10b_load_bound_profile_package":     "Loading bound profile package, It may take a few minutes",
	"es10b_prepare_download":               "Preparing download",
}

Functions

func Download

func Download(dataDir, version string) error

Types

type ActivationCode

type ActivationCode struct {
	SMDP             string
	MatchingId       string
	ConfirmationCode string
	IMEI             string
}

type Cmder

type Cmder struct {
	APDU driver.APDU
}

func NewCmder

func NewCmder(APDU driver.APDU) *Cmder

func (*Cmder) DeleteProfile

func (c *Cmder) DeleteProfile(ICCID string) error

func (*Cmder) Discovery

func (c *Cmder) Discovery() ([]DiscoveryResponse, error)

func (*Cmder) DownloadProfile

func (c *Cmder) DownloadProfile(activationCode ActivationCode, progress Progress) error

func (*Cmder) Info

func (c *Cmder) Info() (Info, error)

func (*Cmder) NotificationDelete

func (c *Cmder) NotificationDelete(seqNumber int) error

func (*Cmder) NotificationList

func (c *Cmder) NotificationList() ([]Notification, error)

func (*Cmder) NotificationProcess

func (c *Cmder) NotificationProcess(seqNumber int, remove bool, progress Progress) error

func (*Cmder) NotificationPurge

func (c *Cmder) NotificationPurge() error

func (*Cmder) ProfileInfo

func (c *Cmder) ProfileInfo(ICCID string) (Profile, error)

func (*Cmder) ProfileList

func (c *Cmder) ProfileList() ([]Profile, error)

func (*Cmder) Run

func (c *Cmder) Run(arguments []string, dst any, progress Progress) error

func (*Cmder) SetNickname

func (c *Cmder) SetNickname(ICCID string, nickname string) error

type CommandAPDUInput

type CommandAPDUInput struct {
	Type    string                  `json:"type"`
	Payload CommandAPDUInputPayload `json:"payload"`
}

type CommandAPDUInputPayload

type CommandAPDUInputPayload struct {
	ECode int    `json:"ecode"`
	Data  string `json:"data,omitempty"`
}

type CommandAPDUPayload

type CommandAPDUPayload struct {
	Func  string `json:"func"`
	Param string `json:"param"`
}

type CommandOutput

type CommandOutput struct {
	Type    string          `json:"type"`
	Payload json.RawMessage `json:"payload"`
}

type DiscoveryResponse

type DiscoveryResponse struct {
	RspServerAddress string `json:"rspServerAddress"`
}

type EuiccConfiguredAddresses

type EuiccConfiguredAddresses struct {
	DefaultDPAddress string `json:"defaultDpAddress"`
	RootDSAddress    string `json:"rootDsAddress"`
}

type EuiccInfo2

type EuiccInfo2 struct {
	SasAccreditationNumber string          `json:"sasAccreditationNumber"`
	ExtCardResource        ExtCardResource `json:"extCardResource"`
	PkiForSigning          []string        `json:"euiccCiPKIdListForSigning"`
}

type ExtCardResource

type ExtCardResource struct {
	FreeNonVolatileMemory int `json:"freeNonVolatileMemory"`
	FreeVolatileMemory    int `json:"freeVolatileMemory"`
}

type GitHubRelease

type GitHubRelease struct {
	TagName string `json:"tag_name"`
	Assets  []GitHubReleaseAsset
}

type GitHubReleaseAsset

type GitHubReleaseAsset struct {
	Name string `json:"name"`
	URL  string `json:"browser_download_url"`
}

type Info

type Info struct {
	EID                      string                   `json:"eidValue"`
	EuiccConfiguredAddresses EuiccConfiguredAddresses `json:"euiccConfiguredAddresses"`
	EUICCInfo2               EuiccInfo2               `json:"euiccInfo2"`
}

type LPAPyaload

type LPAPyaload = Payload

type Notification

type Notification struct {
	SeqNumber                  int    `json:"seqNumber"`
	ProfileManagementOperation string `json:"profileManagementOperation"`
	NotificationAddress        string `json:"notificationAddress"`
	ICCID                      string `json:"iccid"`
}

type Payload

type Payload struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data"`
}

type Profile

type Profile struct {
	ICCID        string `json:"iccid"`
	ISDPAid      string `json:"isdpAid"`
	State        string `json:"profileState"`
	Nickname     string `json:"profileNickname"`
	ProviderName string `json:"serviceProviderName"`
	ProfileName  string `json:"profileName"`
	IconType     string `json:"iconType"`
	Icon         string `json:"icon"`
	Class        string `json:"profileClass"`
}

type Progress

type Progress = func(current string) error

type ProgressPayload

type ProgressPayload = Payload

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL