Documentation
¶
Index ¶
- Constants
- type CreationMode
- type DeleteOptions
- type DirProxy
- type DirStub
- type FileAvailability
- type FileIntegrity
- type FileMode
- type FileProperties
- type FileProxy
- func (p *FileProxy) AsBinder() binder.IBinder
- func (p *FileProxy) GetSize(ctx context.Context) (int64, error)
- func (p *FileProxy) Read(ctx context.Context, size int64, offset int64) ([]byte, error)
- func (p *FileProxy) Rename(ctx context.Context, destPath string, destCreateMode CreationMode) error
- func (p *FileProxy) SetSize(ctx context.Context, newSize int64) error
- func (p *FileProxy) Write(ctx context.Context, offset int64, buffer []byte) (int64, error)
- type FileStub
- type IDir
- type IDirServer
- type IFile
- type IFileServer
- type ISecureStorage
- type ISecureStorageServer
- type IStorageSession
- type IStorageSessionServer
- type OpenOptions
- type ReadIntegrity
- type RenameOptions
- type SecureStorageProxy
- type SecureStorageStub
- type StorageSessionProxy
- func (p *StorageSessionProxy) AbandonChanges(ctx context.Context) error
- func (p *StorageSessionProxy) AsBinder() binder.IBinder
- func (p *StorageSessionProxy) CommitChanges(ctx context.Context) error
- func (p *StorageSessionProxy) DeleteFile(ctx context.Context, filePath string, options DeleteOptions) error
- func (p *StorageSessionProxy) OpenDir(ctx context.Context, path string, readIntegrity ReadIntegrity) (IDir, error)
- func (p *StorageSessionProxy) OpenFile(ctx context.Context, filePath string, options OpenOptions) (IFile, error)
- func (p *StorageSessionProxy) RenameFile(ctx context.Context, currentPath string, destPath string, ...) error
- type StorageSessionStub
- type Tamper
Constants ¶
const ( TransactionIFileRead = binder.FirstCallTransaction + 0 TransactionIFileWrite = binder.FirstCallTransaction + 1 TransactionIFileGetSize = binder.FirstCallTransaction + 2 TransactionIFileSetSize = binder.FirstCallTransaction + 3 TransactionIFileRename = binder.FirstCallTransaction + 4 )
const ( MethodIFileRead = "read" MethodIFileWrite = "write" MethodIFileGetSize = "getSize" MethodIFileSetSize = "setSize" MethodIFileRename = "rename" )
const ( ISecureStorageErrUnsupportedProperties int32 = 1 ISecureStorageErrNotFound int32 = 2 ISecureStorageErrAlreadyExists int32 = 3 ISecureStorageErrBadTransaction int32 = 4 ISecureStorageErrFsReset int32 = 5 ISecureStorageErrFsRolledBack int32 = 6 ISecureStorageErrFsTampered int32 = 7 )
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 )
const ( MethodIStorageSessionCommitChanges = "commitChanges" MethodIStorageSessionAbandonChanges = "abandonChanges" MethodIStorageSessionOpenFile = "openFile" MethodIStorageSessionDeleteFile = "deleteFile" MethodIStorageSessionRenameFile = "renameFile" MethodIStorageSessionOpenDir = "openDir" )
const DescriptorIDir = "android.hardware.security.see.storage.IDir"
const DescriptorIFile = "android.hardware.security.see.storage.IFile"
const DescriptorISecureStorage = "android.hardware.security.see.storage.ISecureStorage"
const DescriptorIStorageSession = "android.hardware.security.see.storage.IStorageSession"
const (
MethodIDirReadNextFilenames = "readNextFilenames"
)
const (
MethodISecureStorageStartSession = "startSession"
)
const (
TransactionIDirReadNextFilenames = binder.FirstCallTransaction + 0
)
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 ¶
func NewDirProxy ¶
type DirStub ¶
type DirStub struct {
Impl IDir
Transport binder.VersionAwareTransport
}
DirStub dispatches incoming binder transactions to a typed IDir implementation.
func (*DirStub) Descriptor ¶
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 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 ¶
func NewFileProxy ¶
type FileStub ¶
type FileStub struct {
Impl IFile
Transport binder.VersionAwareTransport
}
FileStub dispatches incoming binder transactions to a typed IFile implementation.
func (*FileStub) Descriptor ¶
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 ¶
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 ¶
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)