Help us shape the future of Go! Take the 2026 Go Developer Survey

gatekeeper

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIGatekeeperDeleteAllUsers = binder.FirstCallTransaction + 0
	TransactionIGatekeeperDeleteUser     = binder.FirstCallTransaction + 1
	TransactionIGatekeeperEnroll         = binder.FirstCallTransaction + 2
	TransactionIGatekeeperVerify         = binder.FirstCallTransaction + 3
)
View Source
const (
	MethodIGatekeeperDeleteAllUsers = "deleteAllUsers"
	MethodIGatekeeperDeleteUser     = "deleteUser"
	MethodIGatekeeperEnroll         = "enroll"
	MethodIGatekeeperVerify         = "verify"
)
View Source
const (
	IGatekeeperStatusReenroll      int32 = 1
	IGatekeeperStatusOk            int32 = 0
	IGatekeeperErrorGeneralFailure int32 = -1
	IGatekeeperErrorRetryTimeout   int32 = -2
	IGatekeeperErrorNotImplemented int32 = -3
)
View Source
const DescriptorIGatekeeper = "android.hardware.gatekeeper.IGatekeeper"

Variables

This section is empty.

Functions

This section is empty.

Types

type GatekeeperEnrollResponse

type GatekeeperEnrollResponse struct {
	StatusCode   int32
	TimeoutMs    int32
	SecureUserId int64
	Data         []byte
}

func (*GatekeeperEnrollResponse) MarshalParcel

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

func (*GatekeeperEnrollResponse) UnmarshalParcel

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

type GatekeeperProxy

type GatekeeperProxy struct {
	Remote binder.IBinder
}

func NewGatekeeperProxy

func NewGatekeeperProxy(
	remote binder.IBinder,
) *GatekeeperProxy

func (*GatekeeperProxy) AsBinder

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

func (*GatekeeperProxy) DeleteAllUsers

func (p *GatekeeperProxy) DeleteAllUsers(
	ctx context.Context,
) error

func (*GatekeeperProxy) DeleteUser

func (p *GatekeeperProxy) DeleteUser(
	ctx context.Context,
	uid int32,
) error

func (*GatekeeperProxy) Enroll

func (p *GatekeeperProxy) Enroll(
	ctx context.Context,
	uid int32,
	currentPasswordHandle []byte,
	currentPassword []byte,
	desiredPassword []byte,
) (GatekeeperEnrollResponse, error)

func (*GatekeeperProxy) Verify

func (p *GatekeeperProxy) Verify(
	ctx context.Context,
	uid int32,
	challenge int64,
	enrolledPasswordHandle []byte,
	providedPassword []byte,
) (GatekeeperVerifyResponse, error)

type GatekeeperStub

type GatekeeperStub struct {
	Impl      IGatekeeper
	Transport binder.VersionAwareTransport
}

GatekeeperStub dispatches incoming binder transactions to a typed IGatekeeper implementation.

func (*GatekeeperStub) Descriptor

func (s *GatekeeperStub) Descriptor() string

func (*GatekeeperStub) OnTransaction

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

type GatekeeperVerifyResponse

type GatekeeperVerifyResponse struct {
	StatusCode        int32
	TimeoutMs         int32
	HardwareAuthToken keymaster.HardwareAuthToken
}

func (*GatekeeperVerifyResponse) MarshalParcel

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

func (*GatekeeperVerifyResponse) UnmarshalParcel

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

type IGatekeeper

type IGatekeeper interface {
	AsBinder() binder.IBinder
	DeleteAllUsers(ctx context.Context) error
	DeleteUser(ctx context.Context, uid int32) error
	Enroll(ctx context.Context, uid int32, currentPasswordHandle []byte, currentPassword []byte, desiredPassword []byte) (GatekeeperEnrollResponse, error)
	Verify(ctx context.Context, uid int32, challenge int64, enrolledPasswordHandle []byte, providedPassword []byte) (GatekeeperVerifyResponse, error)
}

func NewGatekeeperStub

func NewGatekeeperStub(
	impl IGatekeeperServer,
) IGatekeeper

NewGatekeeperStub creates a server-side IGatekeeper wrapping the given server implementation. The returned value satisfies IGatekeeper 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 IGatekeeperServer

type IGatekeeperServer interface {
	DeleteAllUsers(ctx context.Context) error
	DeleteUser(ctx context.Context, uid int32) error
	Enroll(ctx context.Context, uid int32, currentPasswordHandle []byte, currentPassword []byte, desiredPassword []byte) (GatekeeperEnrollResponse, error)
	Verify(ctx context.Context, uid int32, challenge int64, enrolledPasswordHandle []byte, providedPassword []byte) (GatekeeperVerifyResponse, error)
}

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

Jump to

Keyboard shortcuts

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