storage

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIFileRead    = binder.FirstCallTransaction + 0
	TransactionIFileWrite   = binder.FirstCallTransaction + 1
	TransactionIFileGetSize = binder.FirstCallTransaction + 2
	TransactionIFileSetSize = binder.FirstCallTransaction + 3
	TransactionIFileRename  = binder.FirstCallTransaction + 4
)
View Source
const (
	MethodIFileRead    = "read"
	MethodIFileWrite   = "write"
	MethodIFileGetSize = "getSize"
	MethodIFileSetSize = "setSize"
	MethodIFileRename  = "rename"
)
View Source
const (
	ISecureStorageErrUnsupportedProperties int32 = 1
	ISecureStorageErrNotFound              int32 = 2
	ISecureStorageErrAlreadyExists         int32 = 3
	ISecureStorageErrBadTransaction        int32 = 4
	ISecureStorageErrFsReset               int32 = 5
	ISecureStorageErrFsRolledBack          int32 = 6
	ISecureStorageErrFsTampered            int32 = 7
)
View Source
const (
	TransactionIStorageSessionCommitChanges  = binder.FirstCallTransaction + 0
	TransactionIStorageSessionAbandonChanges = binder.FirstCallTransaction + 1
	TransactionIStorageSessionOpenFile       = binder.FirstCallTransaction + 2
	TransactionIStorageSessionDeleteFile     = binder.FirstCallTransaction + 3
	TransactionIStorageSessionRenameFile     = binder.FirstCallTransaction + 4
	TransactionIStorageSessionOpenDir        = binder.FirstCallTransaction + 5
)
View Source
const (
	MethodIStorageSessionCommitChanges  = "commitChanges"
	MethodIStorageSessionAbandonChanges = "abandonChanges"
	MethodIStorageSessionOpenFile       = "openFile"
	MethodIStorageSessionDeleteFile     = "deleteFile"
	MethodIStorageSessionRenameFile     = "renameFile"
	MethodIStorageSessionOpenDir        = "openDir"
)
View Source
const DescriptorIDir = "android.hardware.security.see.storage.IDir"
View Source
const DescriptorIFile = "android.hardware.security.see.storage.IFile"
View Source
const DescriptorISecureStorage = "android.hardware.security.see.storage.ISecureStorage"
View Source
const DescriptorIStorageSession = "android.hardware.security.see.storage.IStorageSession"
View Source
const (
	MethodIDirReadNextFilenames = "readNextFilenames"
)
View Source
const (
	MethodISecureStorageStartSession = "startSession"
)
View Source
const (
	TransactionIDirReadNextFilenames = binder.FirstCallTransaction + 0
)
View Source
const (
	TransactionISecureStorageStartSession = binder.FirstCallTransaction + 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreationMode

type CreationMode int32
const (
	CreationModeNoCreate        CreationMode = 0
	CreationModeCreateExclusive CreationMode = 1
	CreationModeCREATE          CreationMode = 2
)

type DeleteOptions

type DeleteOptions struct {
	ReadIntegrity             ReadIntegrity
	AllowWritesDuringAbUpdate bool
}

func (*DeleteOptions) MarshalParcel

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

func (*DeleteOptions) UnmarshalParcel

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

type DirProxy

type DirProxy struct {
	Remote binder.IBinder
}

func NewDirProxy

func NewDirProxy(
	remote binder.IBinder,
) *DirProxy

func (*DirProxy) AsBinder

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

func (*DirProxy) ReadNextFilenames

func (p *DirProxy) ReadNextFilenames(
	ctx context.Context,
	maxCount int32,
) ([]string, error)

type DirStub

type DirStub struct {
	Impl      IDir
	Transport binder.VersionAwareTransport
}

DirStub dispatches incoming binder transactions to a typed IDir implementation.

func (*DirStub) Descriptor

func (s *DirStub) Descriptor() string

func (*DirStub) OnTransaction

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

type FileAvailability

type FileAvailability int32
const (
	FileAvailabilityBeforeUserdata FileAvailability = 0
	FileAvailabilityAfterUserdata  FileAvailability = 1
)

type FileIntegrity

type FileIntegrity int32
const (
	FileIntegrityTamperProofAtRest       FileIntegrity = 0
	FileIntegrityTamperDetect            FileIntegrity = 1
	FileIntegrityTamperDetectIgnoreReset FileIntegrity = 2
)

type FileMode

type FileMode int32
const (
	FileModeReadOnly  FileMode = 0
	FileModeWriteOnly FileMode = 1
	FileModeReadWrite FileMode = 2
)

type FileProperties

type FileProperties struct {
	Integrity    FileIntegrity
	Availability FileAvailability
	Persistent   bool
}

func (*FileProperties) MarshalParcel

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

func (*FileProperties) UnmarshalParcel

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

type FileProxy

type FileProxy struct {
	Remote binder.IBinder
}

func NewFileProxy

func NewFileProxy(
	remote binder.IBinder,
) *FileProxy

func (*FileProxy) AsBinder

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

func (*FileProxy) GetSize

func (p *FileProxy) GetSize(
	ctx context.Context,
) (int64, error)

func (*FileProxy) Read

func (p *FileProxy) Read(
	ctx context.Context,
	size int64,
	offset int64,
) ([]byte, error)

func (*FileProxy) Rename

func (p *FileProxy) Rename(
	ctx context.Context,
	destPath string,
	destCreateMode CreationMode,
) error

func (*FileProxy) SetSize

func (p *FileProxy) SetSize(
	ctx context.Context,
	newSize int64,
) error

func (*FileProxy) Write

func (p *FileProxy) Write(
	ctx context.Context,
	offset int64,
	buffer []byte,
) (int64, error)

type FileStub

type FileStub struct {
	Impl      IFile
	Transport binder.VersionAwareTransport
}

FileStub dispatches incoming binder transactions to a typed IFile implementation.

func (*FileStub) Descriptor

func (s *FileStub) Descriptor() string

func (*FileStub) OnTransaction

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

type IDir

type IDir interface {
	AsBinder() binder.IBinder
	ReadNextFilenames(ctx context.Context, maxCount int32) ([]string, error)
}

func NewDirStub

func NewDirStub(
	impl IDirServer,
) IDir

NewDirStub creates a server-side IDir wrapping the given server implementation. The returned value satisfies IDir 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 IDirServer

type IDirServer interface {
	ReadNextFilenames(ctx context.Context, maxCount int32) ([]string, error)
}

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

type IFile

type IFile interface {
	AsBinder() binder.IBinder
	Read(ctx context.Context, size int64, offset int64) ([]byte, error)
	Write(ctx context.Context, offset int64, buffer []byte) (int64, error)
	GetSize(ctx context.Context) (int64, error)
	SetSize(ctx context.Context, newSize int64) error
	Rename(ctx context.Context, destPath string, destCreateMode CreationMode) error
}

func NewFileStub

func NewFileStub(
	impl IFileServer,
) IFile

NewFileStub creates a server-side IFile wrapping the given server implementation. The returned value satisfies IFile 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 IFileServer

type IFileServer interface {
	Read(ctx context.Context, size int64, offset int64) ([]byte, error)
	Write(ctx context.Context, offset int64, buffer []byte) (int64, error)
	GetSize(ctx context.Context) (int64, error)
	SetSize(ctx context.Context, newSize int64) error
	Rename(ctx context.Context, destPath string, destCreateMode CreationMode) error
}

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

type ISecureStorage

type ISecureStorage interface {
	AsBinder() binder.IBinder
	StartSession(ctx context.Context, properties FileProperties) (IStorageSession, error)
}

func NewSecureStorageStub

func NewSecureStorageStub(
	impl ISecureStorageServer,
) ISecureStorage

NewSecureStorageStub creates a server-side ISecureStorage wrapping the given server implementation. The returned value satisfies ISecureStorage 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 ISecureStorageServer

type ISecureStorageServer interface {
	StartSession(ctx context.Context, properties FileProperties) (IStorageSession, error)
}

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

type IStorageSession

type IStorageSession interface {
	AsBinder() binder.IBinder
	CommitChanges(ctx context.Context) error
	AbandonChanges(ctx context.Context) error
	OpenFile(ctx context.Context, filePath string, options OpenOptions) (IFile, error)
	DeleteFile(ctx context.Context, filePath string, options DeleteOptions) error
	RenameFile(ctx context.Context, currentPath string, destPath string, options RenameOptions) error
	OpenDir(ctx context.Context, path string, readIntegrity ReadIntegrity) (IDir, error)
}

func NewStorageSessionStub

func NewStorageSessionStub(
	impl IStorageSessionServer,
) IStorageSession

NewStorageSessionStub creates a server-side IStorageSession wrapping the given server implementation. The returned value satisfies IStorageSession 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 IStorageSessionServer

type IStorageSessionServer interface {
	CommitChanges(ctx context.Context) error
	AbandonChanges(ctx context.Context) error
	OpenFile(ctx context.Context, filePath string, options OpenOptions) (IFile, error)
	DeleteFile(ctx context.Context, filePath string, options DeleteOptions) error
	RenameFile(ctx context.Context, currentPath string, destPath string, options RenameOptions) error
	OpenDir(ctx context.Context, path string, readIntegrity ReadIntegrity) (IDir, error)
}

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

type OpenOptions

type OpenOptions struct {
	CreateMode                CreationMode
	AccessMode                FileMode
	ReadIntegrity             ReadIntegrity
	TruncateOnOpen            bool
	AllowWritesDuringAbUpdate bool
}

func (*OpenOptions) MarshalParcel

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

func (*OpenOptions) UnmarshalParcel

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

type ReadIntegrity

type ReadIntegrity int32
const (
	ReadIntegrityNoTamper       ReadIntegrity = 0
	ReadIntegrityIgnoreReset    ReadIntegrity = 1
	ReadIntegrityIgnoreRollback ReadIntegrity = 2
)

type RenameOptions

type RenameOptions struct {
	DestCreateMode            CreationMode
	ReadIntegrity             ReadIntegrity
	AllowWritesDuringAbUpdate bool
}

func (*RenameOptions) MarshalParcel

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

func (*RenameOptions) UnmarshalParcel

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

type SecureStorageProxy

type SecureStorageProxy struct {
	Remote binder.IBinder
}

func NewSecureStorageProxy

func NewSecureStorageProxy(
	remote binder.IBinder,
) *SecureStorageProxy

func (*SecureStorageProxy) AsBinder

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

func (*SecureStorageProxy) StartSession

func (p *SecureStorageProxy) StartSession(
	ctx context.Context,
	properties FileProperties,
) (IStorageSession, error)

type SecureStorageStub

type SecureStorageStub struct {
	Impl      ISecureStorage
	Transport binder.VersionAwareTransport
}

SecureStorageStub dispatches incoming binder transactions to a typed ISecureStorage implementation.

func (*SecureStorageStub) Descriptor

func (s *SecureStorageStub) Descriptor() string

func (*SecureStorageStub) OnTransaction

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

type StorageSessionProxy

type StorageSessionProxy struct {
	Remote binder.IBinder
}

func NewStorageSessionProxy

func NewStorageSessionProxy(
	remote binder.IBinder,
) *StorageSessionProxy

func (*StorageSessionProxy) AbandonChanges

func (p *StorageSessionProxy) AbandonChanges(
	ctx context.Context,
) error

func (*StorageSessionProxy) AsBinder

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

func (*StorageSessionProxy) CommitChanges

func (p *StorageSessionProxy) CommitChanges(
	ctx context.Context,
) error

func (*StorageSessionProxy) DeleteFile

func (p *StorageSessionProxy) DeleteFile(
	ctx context.Context,
	filePath string,
	options DeleteOptions,
) error

func (*StorageSessionProxy) OpenDir

func (p *StorageSessionProxy) OpenDir(
	ctx context.Context,
	path string,
	readIntegrity ReadIntegrity,
) (IDir, error)

func (*StorageSessionProxy) OpenFile

func (p *StorageSessionProxy) OpenFile(
	ctx context.Context,
	filePath string,
	options OpenOptions,
) (IFile, error)

func (*StorageSessionProxy) RenameFile

func (p *StorageSessionProxy) RenameFile(
	ctx context.Context,
	currentPath string,
	destPath string,
	options RenameOptions,
) error

type StorageSessionStub

type StorageSessionStub struct {
	Impl      IStorageSession
	Transport binder.VersionAwareTransport
}

StorageSessionStub dispatches incoming binder transactions to a typed IStorageSession implementation.

func (*StorageSessionStub) Descriptor

func (s *StorageSessionStub) Descriptor() string

func (*StorageSessionStub) OnTransaction

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

type Tamper

type Tamper int32
const (
	TamperRESET    Tamper = 0
	TamperROLLBACK Tamper = 1
	TamperOTHER    Tamper = 2
)

Jump to

Keyboard shortcuts

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