sim

package
v0.0.0-...-ac3d764 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullSTKProfile

func FullSTKProfile() stk.Profile

func ProfileFromCallbacks

func ProfileFromCallbacks(callbacks STKCallbacks) stk.Profile

Types

type AKAIdentityState

type AKAIdentityState struct {
	Pseudonym      string
	ReauthIdentity string
	Counter        uint16
	MK             []byte
	KEncr          []byte
	KAut           []byte
}

func (AKAIdentityState) HasPseudonym

func (s AKAIdentityState) HasPseudonym() bool

func (AKAIdentityState) HasReauth

func (s AKAIdentityState) HasReauth() bool

type AKAResult

type AKAResult struct {
	RES    []byte
	CK     []byte
	IK     []byte
	AUTS   []byte
	Reject bool
}

func (AKAResult) AuthenticationRejected

func (r AKAResult) AuthenticationRejected() bool

func (AKAResult) Successful

func (r AKAResult) Successful() bool

func (AKAResult) SynchronizationFailed

func (r AKAResult) SynchronizationFailed() bool

type Card

type Card struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, tx simcard.Reader, logger *slog.Logger) (*Card, error)

func (*Card) AKA

func (u *Card) AKA(ctx context.Context, rand, autn []byte) (AKAResult, error)

func (*Card) AKAIdentityState

func (u *Card) AKAIdentityState() AKAIdentityState

func (*Card) Close

func (u *Card) Close() error

func (*Card) EAPAKA

func (u *Card) EAPAKA(ctx context.Context, rand, autn []byte) (AKAResult, error)

func (*Card) GID1

func (u *Card) GID1() string

func (*Card) GID2

func (u *Card) GID2() string

func (*Card) HomeDomain

func (u *Card) HomeDomain() string

func (*Card) ICCID

func (u *Card) ICCID() string

func (*Card) IMSI

func (u *Card) IMSI() string

func (*Card) MCC

func (u *Card) MCC() string

func (*Card) MNC

func (u *Card) MNC() string

func (*Card) MNCLength

func (u *Card) MNCLength() int

func (*Card) PrivateIdentity

func (u *Card) PrivateIdentity() string

func (*Card) PublicIdentity

func (u *Card) PublicIdentity() string

func (*Card) SMSC

func (u *Card) SMSC() string

func (*Card) SPN

func (u *Card) SPN() string

func (*Card) STK

func (u *Card) STK() (*STK, error)

func (*Card) ServiceCenter

func (u *Card) ServiceCenter() ServiceCenter

func (*Card) SetAKAIdentityState

func (u *Card) SetAKAIdentityState(state AKAIdentityState)

type MBIM

type MBIM struct {
	// contains filtered or unexported fields
}

func NewMBIM

func NewMBIM(client *mbim.Client) (*MBIM, error)

func (*MBIM) Authenticate3G

func (m *MBIM) Authenticate3G(ctx context.Context, req simcard.AuthenticateRequest) ([]byte, error)

func (*MBIM) Close

func (m *MBIM) Close() error

func (*MBIM) Commands

func (m *MBIM) Commands(ctx context.Context, profile stk.Profile) (<-chan STKSession, error)

func (*MBIM) Envelope

func (m *MBIM) Envelope(ctx context.Context, envelope []byte) (stk.EnvelopeResponse, error)

func (*MBIM) FileAttributes

func (m *MBIM) FileAttributes(ctx context.Context, file simcard.FileRef) (simcard.FileAttributes, error)

func (*MBIM) ListApplications

func (m *MBIM) ListApplications(ctx context.Context) ([]simcard.Application, error)

func (*MBIM) ReadRecord

func (m *MBIM) ReadRecord(ctx context.Context, req simcard.RecordRead) ([]byte, error)

func (*MBIM) ReadTransparent

func (m *MBIM) ReadTransparent(ctx context.Context, req simcard.TransparentRead) ([]byte, error)

func (*MBIM) Respond

func (m *MBIM) Respond(ctx context.Context, session STKSession, response stk.TerminalResponse) error

func (*MBIM) STK

func (m *MBIM) STK() (*STK, error)

func (*MBIM) TerminalResponse

func (m *MBIM) TerminalResponse(ctx context.Context, _ uint32, response []byte) error

type QCOM

type QCOM struct {
	// contains filtered or unexported fields
}

func NewQCOM

func NewQCOM(client *qc.Client) (*QCOM, error)

func (*QCOM) Authenticate3G

func (r *QCOM) Authenticate3G(ctx context.Context, req simcard.AuthenticateRequest) ([]byte, error)

func (*QCOM) Close

func (r *QCOM) Close() error

func (*QCOM) Commands

func (r *QCOM) Commands(ctx context.Context, profile stk.Profile) (<-chan STKSession, error)

func (*QCOM) Envelope

func (r *QCOM) Envelope(ctx context.Context, envelope []byte) (stk.EnvelopeResponse, error)

func (*QCOM) FileAttributes

func (r *QCOM) FileAttributes(ctx context.Context, file simcard.FileRef) (simcard.FileAttributes, error)

func (*QCOM) ListApplications

func (r *QCOM) ListApplications(ctx context.Context) ([]simcard.Application, error)

func (*QCOM) ReadRecord

func (r *QCOM) ReadRecord(ctx context.Context, req simcard.RecordRead) ([]byte, error)

func (*QCOM) ReadTransparent

func (r *QCOM) ReadTransparent(ctx context.Context, req simcard.TransparentRead) ([]byte, error)

func (*QCOM) Respond

func (r *QCOM) Respond(ctx context.Context, session STKSession, response stk.TerminalResponse) error

func (*QCOM) STK

func (r *QCOM) STK() (*STK, error)

func (*QCOM) TerminalResponse

func (r *QCOM) TerminalResponse(ctx context.Context, ref uint32, response []byte) error

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(tx simcard.Transmitter) (*Reader, error)

func (*Reader) Authenticate3G

func (r *Reader) Authenticate3G(ctx context.Context, req simcard.AuthenticateRequest) ([]byte, error)

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Commands

func (r *Reader) Commands(ctx context.Context, profile stk.Profile) (<-chan STKSession, error)

func (*Reader) Envelope

func (r *Reader) Envelope(ctx context.Context, envelope []byte) (stk.EnvelopeResponse, error)

func (*Reader) FileAttributes

func (r *Reader) FileAttributes(ctx context.Context, file simcard.FileRef) (simcard.FileAttributes, error)

func (*Reader) ListApplications

func (r *Reader) ListApplications(ctx context.Context) ([]simcard.Application, error)

func (*Reader) ReadRecord

func (r *Reader) ReadRecord(ctx context.Context, req simcard.RecordRead) ([]byte, error)

func (*Reader) ReadTransparent

func (r *Reader) ReadTransparent(ctx context.Context, req simcard.TransparentRead) ([]byte, error)

func (*Reader) Respond

func (r *Reader) Respond(ctx context.Context, session STKSession, response stk.TerminalResponse) error

func (*Reader) STK

func (r *Reader) STK() (*STK, error)

func (*Reader) TerminalResponse

func (r *Reader) TerminalResponse(ctx context.Context, _ uint32, data []byte) error

type STK

type STK struct {
	// contains filtered or unexported fields
}

func (*STK) Handle

func (s *STK) Handle(ctx context.Context, session STKSession, callbacks STKCallbacks) error

func (*STK) Run

func (s *STK) Run(ctx context.Context, callbacks STKCallbacks) error

func (*STK) SendEnvelope

func (s *STK) SendEnvelope(ctx context.Context, envelope stk.Envelope) (stk.EnvelopeResponse, error)

func (*STK) SendRawEnvelope

func (s *STK) SendRawEnvelope(ctx context.Context, envelope []byte) (stk.EnvelopeResponse, error)

type STKCallback

type STKCallback[T stk.Command] func(context.Context, T) (stk.TerminalResponse, error)

type STKSession

type STKSession struct {
	Ref     uint32
	Command stk.Command
	Err     error
	// contains filtered or unexported fields
}

type ServiceCenter

type ServiceCenter struct {
	Address string
	PSI     string
}

func (ServiceCenter) Target

func (s ServiceCenter) Target() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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