secure_element

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionISecureElementCloseChannel       = binder.FirstCallTransaction + 0
	TransactionISecureElementGetAtr             = binder.FirstCallTransaction + 1
	TransactionISecureElementInit               = binder.FirstCallTransaction + 2
	TransactionISecureElementIsCardPresent      = binder.FirstCallTransaction + 3
	TransactionISecureElementOpenBasicChannel   = binder.FirstCallTransaction + 4
	TransactionISecureElementOpenLogicalChannel = binder.FirstCallTransaction + 5
	TransactionISecureElementReset              = binder.FirstCallTransaction + 6
	TransactionISecureElementTransmit           = binder.FirstCallTransaction + 7
)
View Source
const (
	MethodISecureElementCloseChannel       = "closeChannel"
	MethodISecureElementGetAtr             = "getAtr"
	MethodISecureElementInit               = "init"
	MethodISecureElementIsCardPresent      = "isCardPresent"
	MethodISecureElementOpenBasicChannel   = "openBasicChannel"
	MethodISecureElementOpenLogicalChannel = "openLogicalChannel"
	MethodISecureElementReset              = "reset"
	MethodISecureElementTransmit           = "transmit"
)
View Source
const (
	ISecureElementFAILED               int32 = 1
	ISecureElementChannelNotAvailable  int32 = 2
	ISecureElementNoSuchElementError   int32 = 3
	ISecureElementUnsupportedOperation int32 = 4
	ISecureElementIOERROR              int32 = 5
)
View Source
const DescriptorISecureElement = "android.hardware.secure_element.ISecureElement"
View Source
const DescriptorISecureElementCallback = "android.hardware.secure_element.ISecureElementCallback"
View Source
const (
	MethodISecureElementCallbackOnStateChange = "onStateChange"
)
View Source
const (
	TransactionISecureElementCallbackOnStateChange = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ISecureElement

type ISecureElement interface {
	AsBinder() binder.IBinder
	CloseChannel(ctx context.Context, channelNumber byte) error
	GetAtr(ctx context.Context) ([]byte, error)
	Init(ctx context.Context, clientCallback ISecureElementCallback) error
	IsCardPresent(ctx context.Context) (bool, error)
	OpenBasicChannel(ctx context.Context, aid []byte, p2 byte) ([]byte, error)
	OpenLogicalChannel(ctx context.Context, aid []byte, p2 byte) (LogicalChannelResponse, error)
	Reset(ctx context.Context) error
	Transmit(ctx context.Context, data []byte) ([]byte, error)
}

func NewSecureElementStub

func NewSecureElementStub(
	impl ISecureElementServer,
) ISecureElement

NewSecureElementStub creates a server-side ISecureElement wrapping the given server implementation. The returned value satisfies ISecureElement and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ISecureElementCallback

type ISecureElementCallback interface {
	AsBinder() binder.IBinder
	OnStateChange(ctx context.Context, connected bool, debugReason string) error
}

func NewSecureElementCallbackStub

func NewSecureElementCallbackStub(
	impl ISecureElementCallbackServer,
) ISecureElementCallback

NewSecureElementCallbackStub creates a server-side ISecureElementCallback wrapping the given server implementation. The returned value satisfies ISecureElementCallback and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ISecureElementCallbackServer

type ISecureElementCallbackServer interface {
	OnStateChange(ctx context.Context, connected bool, debugReason string) error
}

ISecureElementCallbackServer is the server-side interface that user implementations provide to NewSecureElementCallbackStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type ISecureElementServer

type ISecureElementServer interface {
	CloseChannel(ctx context.Context, channelNumber byte) error
	GetAtr(ctx context.Context) ([]byte, error)
	Init(ctx context.Context, clientCallback ISecureElementCallback) error
	IsCardPresent(ctx context.Context) (bool, error)
	OpenBasicChannel(ctx context.Context, aid []byte, p2 byte) ([]byte, error)
	OpenLogicalChannel(ctx context.Context, aid []byte, p2 byte) (LogicalChannelResponse, error)
	Reset(ctx context.Context) error
	Transmit(ctx context.Context, data []byte) ([]byte, error)
}

ISecureElementServer is the server-side interface that user implementations provide to NewSecureElementStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type LogicalChannelResponse

type LogicalChannelResponse struct {
	ChannelNumber  byte
	SelectResponse []byte
}

func (*LogicalChannelResponse) MarshalParcel

func (s *LogicalChannelResponse) MarshalParcel(
	p *parcel.Parcel,
) error

func (*LogicalChannelResponse) UnmarshalParcel

func (s *LogicalChannelResponse) UnmarshalParcel(
	p *parcel.Parcel,
) error

type SecureElementCallbackProxy

type SecureElementCallbackProxy struct {
	Remote binder.IBinder
}

func NewSecureElementCallbackProxy

func NewSecureElementCallbackProxy(
	remote binder.IBinder,
) *SecureElementCallbackProxy

func (*SecureElementCallbackProxy) AsBinder

func (*SecureElementCallbackProxy) OnStateChange

func (p *SecureElementCallbackProxy) OnStateChange(
	ctx context.Context,
	connected bool,
	debugReason string,
) error

type SecureElementCallbackStub

type SecureElementCallbackStub struct {
	Impl      ISecureElementCallback
	Transport binder.VersionAwareTransport
}

SecureElementCallbackStub dispatches incoming binder transactions to a typed ISecureElementCallback implementation.

func (*SecureElementCallbackStub) Descriptor

func (s *SecureElementCallbackStub) Descriptor() string

func (*SecureElementCallbackStub) OnTransaction

func (s *SecureElementCallbackStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type SecureElementProxy

type SecureElementProxy struct {
	Remote binder.IBinder
}

func NewSecureElementProxy

func NewSecureElementProxy(
	remote binder.IBinder,
) *SecureElementProxy

func (*SecureElementProxy) AsBinder

func (p *SecureElementProxy) AsBinder() binder.IBinder

func (*SecureElementProxy) CloseChannel

func (p *SecureElementProxy) CloseChannel(
	ctx context.Context,
	channelNumber byte,
) error

func (*SecureElementProxy) GetAtr

func (p *SecureElementProxy) GetAtr(
	ctx context.Context,
) ([]byte, error)

func (*SecureElementProxy) Init

func (p *SecureElementProxy) Init(
	ctx context.Context,
	clientCallback ISecureElementCallback,
) error

func (*SecureElementProxy) IsCardPresent

func (p *SecureElementProxy) IsCardPresent(
	ctx context.Context,
) (bool, error)

func (*SecureElementProxy) OpenBasicChannel

func (p *SecureElementProxy) OpenBasicChannel(
	ctx context.Context,
	aid []byte,
	p2 byte,
) ([]byte, error)

func (*SecureElementProxy) OpenLogicalChannel

func (p *SecureElementProxy) OpenLogicalChannel(
	ctx context.Context,
	aid []byte,
	p2 byte,
) (LogicalChannelResponse, error)

func (*SecureElementProxy) Reset

func (p *SecureElementProxy) Reset(
	ctx context.Context,
) error

func (*SecureElementProxy) Transmit

func (p *SecureElementProxy) Transmit(
	ctx context.Context,
	data []byte,
) ([]byte, error)

type SecureElementStub

type SecureElementStub struct {
	Impl      ISecureElement
	Transport binder.VersionAwareTransport
}

SecureElementStub dispatches incoming binder transactions to a typed ISecureElement implementation.

func (*SecureElementStub) Descriptor

func (s *SecureElementStub) Descriptor() string

func (*SecureElementStub) OnTransaction

func (s *SecureElementStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

Jump to

Keyboard shortcuts

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