authgraph

package
v0.0.6 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 (
	TransactionIAuthGraphKeyExchangeCreate                 = binder.FirstCallTransaction + 0
	TransactionIAuthGraphKeyExchangeInit                   = binder.FirstCallTransaction + 1
	TransactionIAuthGraphKeyExchangeFinish                 = binder.FirstCallTransaction + 2
	TransactionIAuthGraphKeyExchangeAuthenticationComplete = binder.FirstCallTransaction + 3
)
View Source
const (
	MethodIAuthGraphKeyExchangeCreate                 = "create"
	MethodIAuthGraphKeyExchangeInit                   = "init"
	MethodIAuthGraphKeyExchangeFinish                 = "finish"
	MethodIAuthGraphKeyExchangeAuthenticationComplete = "authenticationComplete"
)
View Source
const (
	PubKeyTagPlainKey  int32 = 0
	PubKeyTagSignedKey int32 = 1
)
View Source
const DescriptorIAuthGraphKeyExchange = "android.hardware.security.authgraph.IAuthGraphKeyExchange"

Variables

This section is empty.

Functions

This section is empty.

Types

type Arc

type Arc struct {
	Arc []byte
}

func (*Arc) MarshalParcel

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

func (*Arc) UnmarshalParcel

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

type AuthGraphKeyExchangeProxy

type AuthGraphKeyExchangeProxy struct {
	Remote binder.IBinder
}

func NewAuthGraphKeyExchangeProxy

func NewAuthGraphKeyExchangeProxy(
	remote binder.IBinder,
) *AuthGraphKeyExchangeProxy

func (*AuthGraphKeyExchangeProxy) AsBinder

func (*AuthGraphKeyExchangeProxy) AuthenticationComplete

func (p *AuthGraphKeyExchangeProxy) AuthenticationComplete(
	ctx context.Context,
	peerSignature SessionIdSignature,
	sharedKeys []Arc,
) ([]Arc, error)

func (*AuthGraphKeyExchangeProxy) Create

func (*AuthGraphKeyExchangeProxy) Finish

func (p *AuthGraphKeyExchangeProxy) Finish(
	ctx context.Context,
	peerPubKey PubKey,
	peerId Identity,
	peerSignature SessionIdSignature,
	peerNonce []byte,
	peerVersion int32,
	ownKey Key,
) (SessionInfo, error)

func (*AuthGraphKeyExchangeProxy) Init

func (p *AuthGraphKeyExchangeProxy) Init(
	ctx context.Context,
	peerPubKey PubKey,
	peerId Identity,
	peerNonce []byte,
	peerVersion int32,
) (KeInitResult, error)

type AuthGraphKeyExchangeStub

type AuthGraphKeyExchangeStub struct {
	Impl      IAuthGraphKeyExchange
	Transport binder.VersionAwareTransport
}

AuthGraphKeyExchangeStub dispatches incoming binder transactions to a typed IAuthGraphKeyExchange implementation.

func (*AuthGraphKeyExchangeStub) Descriptor

func (s *AuthGraphKeyExchangeStub) Descriptor() string

func (*AuthGraphKeyExchangeStub) OnTransaction

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

type Error

type Error int32
const (
	ErrorOK                          Error = 0
	ErrorInvalidPeerNonce            Error = -1
	ErrorInvalidPeerKeKey            Error = -2
	ErrorInvalidIdentity             Error = -3
	ErrorInvalidCertChain            Error = -4
	ErrorInvalidSignature            Error = -5
	ErrorInvalidKeKey                Error = -6
	ErrorInvalidPubKeyInKey          Error = -7
	ErrorInvalidPrivKeyArcInKey      Error = -8
	ErrorInvalidSharedKeyArcs        Error = -9
	ErrorMemoryAllocationFailed      Error = -10
	ErrorIncompatibleProtocolVersion Error = -11
)

type IAuthGraphKeyExchange

type IAuthGraphKeyExchange interface {
	AsBinder() binder.IBinder
	Create(ctx context.Context) (SessionInitiationInfo, error)
	Init(ctx context.Context, peerPubKey PubKey, peerId Identity, peerNonce []byte, peerVersion int32) (KeInitResult, error)
	Finish(ctx context.Context, peerPubKey PubKey, peerId Identity, peerSignature SessionIdSignature, peerNonce []byte, peerVersion int32, ownKey Key) (SessionInfo, error)
	AuthenticationComplete(ctx context.Context, peerSignature SessionIdSignature, sharedKeys []Arc) ([]Arc, error)
}

func NewAuthGraphKeyExchangeStub

func NewAuthGraphKeyExchangeStub(
	impl IAuthGraphKeyExchangeServer,
) IAuthGraphKeyExchange

NewAuthGraphKeyExchangeStub creates a server-side IAuthGraphKeyExchange wrapping the given server implementation. The returned value satisfies IAuthGraphKeyExchange 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 IAuthGraphKeyExchangeServer

type IAuthGraphKeyExchangeServer interface {
	Create(ctx context.Context) (SessionInitiationInfo, error)
	Init(ctx context.Context, peerPubKey PubKey, peerId Identity, peerNonce []byte, peerVersion int32) (KeInitResult, error)
	Finish(ctx context.Context, peerPubKey PubKey, peerId Identity, peerSignature SessionIdSignature, peerNonce []byte, peerVersion int32, ownKey Key) (SessionInfo, error)
	AuthenticationComplete(ctx context.Context, peerSignature SessionIdSignature, sharedKeys []Arc) ([]Arc, error)
}

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

type Identity

type Identity struct {
	Identity []byte
}

func (*Identity) MarshalParcel

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

func (*Identity) UnmarshalParcel

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

type KeInitResult

type KeInitResult struct {
	SessionInitiationInfo SessionInitiationInfo
	SessionInfo           SessionInfo
}

func (*KeInitResult) MarshalParcel

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

func (*KeInitResult) UnmarshalParcel

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

type Key

type Key struct {
	PubKey     *PubKey
	ArcFromPBK *Arc
}

func (*Key) MarshalParcel

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

func (*Key) UnmarshalParcel

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

type PlainPubKey

type PlainPubKey struct {
	PlainPubKey []byte
}

func (*PlainPubKey) MarshalParcel

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

func (*PlainPubKey) UnmarshalParcel

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

type PubKey

type PubKey struct {
	Tag       int32
	PlainKey  PlainPubKey
	SignedKey SignedPubKey
}

func (*PubKey) GetPlainKey

func (u *PubKey) GetPlainKey() (PlainPubKey, bool)

func (*PubKey) GetSignedKey

func (u *PubKey) GetSignedKey() (SignedPubKey, bool)

func (*PubKey) MarshalParcel

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

func (*PubKey) SetPlainKey

func (u *PubKey) SetPlainKey(
	v PlainPubKey,
)

func (*PubKey) SetSignedKey

func (u *PubKey) SetSignedKey(
	v SignedPubKey,
)

func (*PubKey) UnmarshalParcel

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

type SessionIdSignature

type SessionIdSignature struct {
	Signature []byte
}

func (*SessionIdSignature) MarshalParcel

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

func (*SessionIdSignature) UnmarshalParcel

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

type SessionInfo

type SessionInfo struct {
	SharedKeys []Arc
	SessionId  []byte
	Signature  SessionIdSignature
}

func (*SessionInfo) MarshalParcel

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

func (*SessionInfo) UnmarshalParcel

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

type SessionInitiationInfo

type SessionInitiationInfo struct {
	Key      Key
	Identity Identity
	Nonce    []byte
	Version  int32
}

func (*SessionInitiationInfo) MarshalParcel

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

func (*SessionInitiationInfo) UnmarshalParcel

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

type SignedPubKey

type SignedPubKey struct {
	SignedPubKey []byte
}

func (*SignedPubKey) MarshalParcel

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

func (*SignedPubKey) UnmarshalParcel

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

Jump to

Keyboard shortcuts

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