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

cas

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DestinationBufferTagNonsecureMemory int32 = 0
	DestinationBufferTagSecureMemory    int32 = 1
)
View Source
const (
	TransactionICasCloseSession          = binder.FirstCallTransaction + 0
	TransactionICasOpenSessionDefault    = binder.FirstCallTransaction + 1
	TransactionICasOpenSession           = binder.FirstCallTransaction + 2
	TransactionICasProcessEcm            = binder.FirstCallTransaction + 3
	TransactionICasProcessEmm            = binder.FirstCallTransaction + 4
	TransactionICasProvision             = binder.FirstCallTransaction + 5
	TransactionICasRefreshEntitlements   = binder.FirstCallTransaction + 6
	TransactionICasRelease               = binder.FirstCallTransaction + 7
	TransactionICasSendEvent             = binder.FirstCallTransaction + 8
	TransactionICasSendSessionEvent      = binder.FirstCallTransaction + 9
	TransactionICasSetPrivateData        = binder.FirstCallTransaction + 10
	TransactionICasSetSessionPrivateData = binder.FirstCallTransaction + 11
)
View Source
const (
	MethodICasCloseSession          = "closeSession"
	MethodICasOpenSessionDefault    = "openSessionDefault"
	MethodICasOpenSession           = "openSession"
	MethodICasProcessEcm            = "processEcm"
	MethodICasProcessEmm            = "processEmm"
	MethodICasProvision             = "provision"
	MethodICasRefreshEntitlements   = "refreshEntitlements"
	MethodICasRelease               = "release"
	MethodICasSendEvent             = "sendEvent"
	MethodICasSendSessionEvent      = "sendSessionEvent"
	MethodICasSetPrivateData        = "setPrivateData"
	MethodICasSetSessionPrivateData = "setSessionPrivateData"
)
View Source
const (
	TransactionICasListenerOnEvent        = binder.FirstCallTransaction + 0
	TransactionICasListenerOnSessionEvent = binder.FirstCallTransaction + 1
	TransactionICasListenerOnStatusUpdate = binder.FirstCallTransaction + 2
)
View Source
const (
	MethodICasListenerOnEvent        = "onEvent"
	MethodICasListenerOnSessionEvent = "onSessionEvent"
	MethodICasListenerOnStatusUpdate = "onStatusUpdate"
)
View Source
const (
	TransactionIDescramblerDescramble                     = binder.FirstCallTransaction + 0
	TransactionIDescramblerRelease                        = binder.FirstCallTransaction + 1
	TransactionIDescramblerRequiresSecureDecoderComponent = binder.FirstCallTransaction + 2
	TransactionIDescramblerSetMediaCasSession             = binder.FirstCallTransaction + 3
)
View Source
const (
	MethodIDescramblerDescramble                     = "descramble"
	MethodIDescramblerRelease                        = "release"
	MethodIDescramblerRequiresSecureDecoderComponent = "requiresSecureDecoderComponent"
	MethodIDescramblerSetMediaCasSession             = "setMediaCasSession"
)
View Source
const (
	TransactionIMediaCasServiceCreateDescrambler      = binder.FirstCallTransaction + 0
	TransactionIMediaCasServiceCreatePlugin           = binder.FirstCallTransaction + 1
	TransactionIMediaCasServiceEnumeratePlugins       = binder.FirstCallTransaction + 2
	TransactionIMediaCasServiceIsDescramblerSupported = binder.FirstCallTransaction + 3
	TransactionIMediaCasServiceIsSystemIdSupported    = binder.FirstCallTransaction + 4
)
View Source
const (
	MethodIMediaCasServiceCreateDescrambler      = "createDescrambler"
	MethodIMediaCasServiceCreatePlugin           = "createPlugin"
	MethodIMediaCasServiceEnumeratePlugins       = "enumeratePlugins"
	MethodIMediaCasServiceIsDescramblerSupported = "isDescramblerSupported"
	MethodIMediaCasServiceIsSystemIdSupported    = "isSystemIdSupported"
)
View Source
const (
	StatusOK                                   int32 = 0
	StatusErrorCasNoLicense                    int32 = 1
	StatusErrorCasLicenseExpired               int32 = 2
	StatusErrorCasSessionNotOpened             int32 = 3
	StatusErrorCasCannotHandle                 int32 = 4
	StatusErrorCasInvalidState                 int32 = 5
	StatusBadValue                             int32 = 6
	StatusErrorCasNotProvisioned               int32 = 7
	StatusErrorCasResourceBusy                 int32 = 8
	StatusErrorCasInsufficientOutputProtection int32 = 9
	StatusErrorCasTamperDetected               int32 = 10
	StatusErrorCasDeviceRevoked                int32 = 11
	StatusErrorCasDecryptUnitNotInitialized    int32 = 12
	StatusErrorCasDecrypt                      int32 = 13
	StatusErrorCasUnknown                      int32 = 14
	StatusErrorCasNeedActivation               int32 = 15
	StatusErrorCasNeedPairing                  int32 = 16
	StatusErrorCasNoCard                       int32 = 17
	StatusErrorCasCardMute                     int32 = 18
	StatusErrorCasCardInvalid                  int32 = 19
	StatusErrorCasBlackout                     int32 = 20
	StatusErrorCasRebooting                    int32 = 21
)
View Source
const DescriptorICas = "android.hardware.cas.ICas"
View Source
const DescriptorICasListener = "android.hardware.cas.ICasListener"
View Source
const DescriptorIDescrambler = "android.hardware.cas.IDescrambler"
View Source
const DescriptorIMediaCasService = "android.hardware.cas.IMediaCasService"

Variables

This section is empty.

Functions

This section is empty.

Types

type AidlCasPluginDescriptor

type AidlCasPluginDescriptor struct {
	CaSystemId int32
	Name       string
}

func (*AidlCasPluginDescriptor) MarshalParcel

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

func (*AidlCasPluginDescriptor) UnmarshalParcel

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

type CasListenerProxy

type CasListenerProxy struct {
	Remote binder.IBinder
}

func NewCasListenerProxy

func NewCasListenerProxy(
	remote binder.IBinder,
) *CasListenerProxy

func (*CasListenerProxy) AsBinder

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

func (*CasListenerProxy) OnEvent

func (p *CasListenerProxy) OnEvent(
	ctx context.Context,
	event int32,
	arg int32,
	data []byte,
) error

func (*CasListenerProxy) OnSessionEvent

func (p *CasListenerProxy) OnSessionEvent(
	ctx context.Context,
	sessionId []byte,
	event int32,
	arg int32,
	data []byte,
) error

func (*CasListenerProxy) OnStatusUpdate

func (p *CasListenerProxy) OnStatusUpdate(
	ctx context.Context,
	event StatusEvent,
	number int32,
) error

type CasListenerStub

type CasListenerStub struct {
	Impl      ICasListener
	Transport binder.VersionAwareTransport
}

CasListenerStub dispatches incoming binder transactions to a typed ICasListener implementation.

func (*CasListenerStub) Descriptor

func (s *CasListenerStub) Descriptor() string

func (*CasListenerStub) OnTransaction

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

type CasProxy

type CasProxy struct {
	Remote binder.IBinder
}

func NewCasProxy

func NewCasProxy(
	remote binder.IBinder,
) *CasProxy

func (*CasProxy) AsBinder

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

func (*CasProxy) CloseSession

func (p *CasProxy) CloseSession(
	ctx context.Context,
	sessionId []byte,
) error

func (*CasProxy) OpenSession

func (p *CasProxy) OpenSession(
	ctx context.Context,
	intent SessionIntent,
	mode ScramblingMode,
) ([]byte, error)

func (*CasProxy) OpenSessionDefault

func (p *CasProxy) OpenSessionDefault(
	ctx context.Context,
) ([]byte, error)

func (*CasProxy) ProcessEcm

func (p *CasProxy) ProcessEcm(
	ctx context.Context,
	sessionId []byte,
	ecm []byte,
) error

func (*CasProxy) ProcessEmm

func (p *CasProxy) ProcessEmm(
	ctx context.Context,
	emm []byte,
) error

func (*CasProxy) Provision

func (p *CasProxy) Provision(
	ctx context.Context,
	provisionString string,
) error

func (*CasProxy) RefreshEntitlements

func (p *CasProxy) RefreshEntitlements(
	ctx context.Context,
	refreshType int32,
	refreshData []byte,
) error

func (*CasProxy) Release

func (p *CasProxy) Release(
	ctx context.Context,
) error

func (*CasProxy) SendEvent

func (p *CasProxy) SendEvent(
	ctx context.Context,
	event int32,
	arg int32,
	eventData []byte,
) error

func (*CasProxy) SendSessionEvent

func (p *CasProxy) SendSessionEvent(
	ctx context.Context,
	sessionId []byte,
	event int32,
	arg int32,
	eventData []byte,
) error

func (*CasProxy) SetPrivateData

func (p *CasProxy) SetPrivateData(
	ctx context.Context,
	pvtData []byte,
) error

func (*CasProxy) SetSessionPrivateData

func (p *CasProxy) SetSessionPrivateData(
	ctx context.Context,
	sessionId []byte,
	pvtData []byte,
) error

type CasStub

type CasStub struct {
	Impl      ICas
	Transport binder.VersionAwareTransport
}

CasStub dispatches incoming binder transactions to a typed ICas implementation.

func (*CasStub) Descriptor

func (s *CasStub) Descriptor() string

func (*CasStub) OnTransaction

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

type DescramblerProxy

type DescramblerProxy struct {
	Remote binder.IBinder
}

func NewDescramblerProxy

func NewDescramblerProxy(
	remote binder.IBinder,
) *DescramblerProxy

func (*DescramblerProxy) AsBinder

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

func (*DescramblerProxy) Descramble

func (p *DescramblerProxy) Descramble(
	ctx context.Context,
	scramblingControl ScramblingControl,
	subSamples []SubSample,
	srcBuffer SharedBuffer,
	srcOffset int64,
	dstBuffer DestinationBuffer,
	dstOffset int64,
) (int32, error)

func (*DescramblerProxy) Release

func (p *DescramblerProxy) Release(
	ctx context.Context,
) error

func (*DescramblerProxy) RequiresSecureDecoderComponent

func (p *DescramblerProxy) RequiresSecureDecoderComponent(
	ctx context.Context,
	mime string,
) (bool, error)

func (*DescramblerProxy) SetMediaCasSession

func (p *DescramblerProxy) SetMediaCasSession(
	ctx context.Context,
	sessionId []byte,
) error

type DescramblerStub

type DescramblerStub struct {
	Impl      IDescrambler
	Transport binder.VersionAwareTransport
}

DescramblerStub dispatches incoming binder transactions to a typed IDescrambler implementation.

func (*DescramblerStub) Descriptor

func (s *DescramblerStub) Descriptor() string

func (*DescramblerStub) OnTransaction

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

type DestinationBuffer

type DestinationBuffer struct {
	Tag             int32
	NonsecureMemory SharedBuffer
	SecureMemory    common.NativeHandle
}

func (*DestinationBuffer) GetNonsecureMemory

func (u *DestinationBuffer) GetNonsecureMemory() (SharedBuffer, bool)

func (*DestinationBuffer) GetSecureMemory

func (u *DestinationBuffer) GetSecureMemory() (common.NativeHandle, bool)

func (*DestinationBuffer) MarshalParcel

func (u *DestinationBuffer) MarshalParcel(
	p *parcel.Parcel,
) error

func (*DestinationBuffer) SetNonsecureMemory

func (u *DestinationBuffer) SetNonsecureMemory(
	v SharedBuffer,
)

func (*DestinationBuffer) SetSecureMemory

func (u *DestinationBuffer) SetSecureMemory(
	v common.NativeHandle,
)

func (*DestinationBuffer) UnmarshalParcel

func (u *DestinationBuffer) UnmarshalParcel(
	p *parcel.Parcel,
) error

type ICas

type ICas interface {
	AsBinder() binder.IBinder
	CloseSession(ctx context.Context, sessionId []byte) error
	OpenSessionDefault(ctx context.Context) ([]byte, error)
	OpenSession(ctx context.Context, intent SessionIntent, mode ScramblingMode) ([]byte, error)
	ProcessEcm(ctx context.Context, sessionId []byte, ecm []byte) error
	ProcessEmm(ctx context.Context, emm []byte) error
	Provision(ctx context.Context, provisionString string) error
	RefreshEntitlements(ctx context.Context, refreshType int32, refreshData []byte) error
	Release(ctx context.Context) error
	SendEvent(ctx context.Context, event int32, arg int32, eventData []byte) error
	SendSessionEvent(ctx context.Context, sessionId []byte, event int32, arg int32, eventData []byte) error
	SetPrivateData(ctx context.Context, pvtData []byte) error
	SetSessionPrivateData(ctx context.Context, sessionId []byte, pvtData []byte) error
}

func NewCasStub

func NewCasStub(
	impl ICasServer,
) ICas

NewCasStub creates a server-side ICas wrapping the given server implementation. The returned value satisfies ICas 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 ICasListener

type ICasListener interface {
	AsBinder() binder.IBinder
	OnEvent(ctx context.Context, event int32, arg int32, data []byte) error
	OnSessionEvent(ctx context.Context, sessionId []byte, event int32, arg int32, data []byte) error
	OnStatusUpdate(ctx context.Context, event StatusEvent, number int32) error
}

func NewCasListenerStub

func NewCasListenerStub(
	impl ICasListenerServer,
) ICasListener

NewCasListenerStub creates a server-side ICasListener wrapping the given server implementation. The returned value satisfies ICasListener 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 ICasListenerServer

type ICasListenerServer interface {
	OnEvent(ctx context.Context, event int32, arg int32, data []byte) error
	OnSessionEvent(ctx context.Context, sessionId []byte, event int32, arg int32, data []byte) error
	OnStatusUpdate(ctx context.Context, event StatusEvent, number int32) error
}

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

type ICasServer

type ICasServer interface {
	CloseSession(ctx context.Context, sessionId []byte) error
	OpenSessionDefault(ctx context.Context) ([]byte, error)
	OpenSession(ctx context.Context, intent SessionIntent, mode ScramblingMode) ([]byte, error)
	ProcessEcm(ctx context.Context, sessionId []byte, ecm []byte) error
	ProcessEmm(ctx context.Context, emm []byte) error
	Provision(ctx context.Context, provisionString string) error
	RefreshEntitlements(ctx context.Context, refreshType int32, refreshData []byte) error
	Release(ctx context.Context) error
	SendEvent(ctx context.Context, event int32, arg int32, eventData []byte) error
	SendSessionEvent(ctx context.Context, sessionId []byte, event int32, arg int32, eventData []byte) error
	SetPrivateData(ctx context.Context, pvtData []byte) error
	SetSessionPrivateData(ctx context.Context, sessionId []byte, pvtData []byte) error
}

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

type IDescrambler

type IDescrambler interface {
	AsBinder() binder.IBinder
	Descramble(ctx context.Context, scramblingControl ScramblingControl, subSamples []SubSample, srcBuffer SharedBuffer, srcOffset int64, dstBuffer DestinationBuffer, dstOffset int64) (int32, error)
	Release(ctx context.Context) error
	RequiresSecureDecoderComponent(ctx context.Context, mime string) (bool, error)
	SetMediaCasSession(ctx context.Context, sessionId []byte) error
}

func NewDescramblerStub

func NewDescramblerStub(
	impl IDescramblerServer,
) IDescrambler

NewDescramblerStub creates a server-side IDescrambler wrapping the given server implementation. The returned value satisfies IDescrambler 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 IDescramblerServer

type IDescramblerServer interface {
	Descramble(ctx context.Context, scramblingControl ScramblingControl, subSamples []SubSample, srcBuffer SharedBuffer, srcOffset int64, dstBuffer DestinationBuffer, dstOffset int64) (int32, error)
	Release(ctx context.Context) error
	RequiresSecureDecoderComponent(ctx context.Context, mime string) (bool, error)
	SetMediaCasSession(ctx context.Context, sessionId []byte) error
}

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

type IMediaCasService

type IMediaCasService interface {
	AsBinder() binder.IBinder
	CreateDescrambler(ctx context.Context, CA_system_id int32) (IDescrambler, error)
	CreatePlugin(ctx context.Context, CA_system_id int32, listener ICasListener) (ICas, error)
	EnumeratePlugins(ctx context.Context) ([]AidlCasPluginDescriptor, error)
	IsDescramblerSupported(ctx context.Context, CA_system_id int32) (bool, error)
	IsSystemIdSupported(ctx context.Context, CA_system_id int32) (bool, error)
}

func NewMediaCasServiceStub

func NewMediaCasServiceStub(
	impl IMediaCasServiceServer,
) IMediaCasService

NewMediaCasServiceStub creates a server-side IMediaCasService wrapping the given server implementation. The returned value satisfies IMediaCasService 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 IMediaCasServiceServer

type IMediaCasServiceServer interface {
	CreateDescrambler(ctx context.Context, CA_system_id int32) (IDescrambler, error)
	CreatePlugin(ctx context.Context, CA_system_id int32, listener ICasListener) (ICas, error)
	EnumeratePlugins(ctx context.Context) ([]AidlCasPluginDescriptor, error)
	IsDescramblerSupported(ctx context.Context, CA_system_id int32) (bool, error)
	IsSystemIdSupported(ctx context.Context, CA_system_id int32) (bool, error)
}

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

type MediaCasServiceProxy

type MediaCasServiceProxy struct {
	Remote binder.IBinder
}

func NewMediaCasServiceProxy

func NewMediaCasServiceProxy(
	remote binder.IBinder,
) *MediaCasServiceProxy

func (*MediaCasServiceProxy) AsBinder

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

func (*MediaCasServiceProxy) CreateDescrambler

func (p *MediaCasServiceProxy) CreateDescrambler(
	ctx context.Context,
	CA_system_id int32,
) (IDescrambler, error)

func (*MediaCasServiceProxy) CreatePlugin

func (p *MediaCasServiceProxy) CreatePlugin(
	ctx context.Context,
	CA_system_id int32,
	listener ICasListener,
) (ICas, error)

func (*MediaCasServiceProxy) EnumeratePlugins

func (p *MediaCasServiceProxy) EnumeratePlugins(
	ctx context.Context,
) ([]AidlCasPluginDescriptor, error)

func (*MediaCasServiceProxy) IsDescramblerSupported

func (p *MediaCasServiceProxy) IsDescramblerSupported(
	ctx context.Context,
	CA_system_id int32,
) (bool, error)

func (*MediaCasServiceProxy) IsSystemIdSupported

func (p *MediaCasServiceProxy) IsSystemIdSupported(
	ctx context.Context,
	CA_system_id int32,
) (bool, error)

type MediaCasServiceStub

type MediaCasServiceStub struct {
	Impl      IMediaCasService
	Transport binder.VersionAwareTransport
}

MediaCasServiceStub dispatches incoming binder transactions to a typed IMediaCasService implementation.

func (*MediaCasServiceStub) Descriptor

func (s *MediaCasServiceStub) Descriptor() string

func (*MediaCasServiceStub) OnTransaction

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

type ScramblingControl

type ScramblingControl int32
const (
	ScramblingControlUNSCRAMBLED ScramblingControl = 0
	ScramblingControlRESERVED    ScramblingControl = 1
	ScramblingControlEVENKEY     ScramblingControl = 2
	ScramblingControlODDKEY      ScramblingControl = 3
)

type ScramblingMode

type ScramblingMode int32
const (
	ScramblingModeRESERVED        ScramblingMode = 0
	ScramblingModeDvbCsa1         ScramblingMode = 1
	ScramblingModeDvbCsa2         ScramblingMode = 2
	ScramblingModeDvbCsa3Standard ScramblingMode = 3
	ScramblingModeDvbCsa3Minimal  ScramblingMode = 4
	ScramblingModeDvbCsa3Enhance  ScramblingMode = 5
	ScramblingModeDvbCissaV1      ScramblingMode = 6
	ScramblingModeDvbIdsa         ScramblingMode = 7
	ScramblingModeMULTI2          ScramblingMode = 8
	ScramblingModeAES128          ScramblingMode = 9
	ScramblingModeAesEcb          ScramblingMode = 10
	ScramblingModeAesScte52       ScramblingMode = 11
	ScramblingModeTdesEcb         ScramblingMode = 12
	ScramblingModeTdesScte52      ScramblingMode = 13
	ScramblingModeAesCbc          ScramblingMode = 14
)

type SessionIntent

type SessionIntent int32
const (
	SessionIntentLIVE      SessionIntent = 0
	SessionIntentPLAYBACK  SessionIntent = 1
	SessionIntentRECORD    SessionIntent = 2
	SessionIntentTIMESHIFT SessionIntent = 3
)

type SharedBuffer

type SharedBuffer struct {
	HeapBase common.Ashmem
	Offset   int64
	Size     int64
}

func (*SharedBuffer) MarshalParcel

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

func (*SharedBuffer) UnmarshalParcel

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

type Status

type Status struct {
}

func (*Status) MarshalParcel

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

func (*Status) UnmarshalParcel

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

type StatusEvent

type StatusEvent byte
const (
	StatusEventPluginPhysicalModuleChanged StatusEvent = 0
	StatusEventPluginSessionNumberChanged  StatusEvent = 1
)

type SubSample

type SubSample struct {
	NumBytesOfClearData     int32
	NumBytesOfEncryptedData int32
}

func (*SubSample) MarshalParcel

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

func (*SubSample) UnmarshalParcel

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

Jump to

Keyboard shortcuts

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