types

package
v2.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SDKSalt         = "LKFrameEncryptionKey"
	IVLength        = 12
	PBKDFIterations = 100000
	KeySizeBytes    = 16
	HKDFInfoBytes   = 128
	// MaxKeyIndex is the largest key index the one-byte frame trailer can carry.
	MaxKeyIndex = 255
)

Variables

View Source
var (
	ErrIncorrectKeyLength  = errors.New("incorrect key length for encryption/decryption")
	ErrUnableGenerateIV    = errors.New("unable to generate iv for encryption")
	ErrIncorrectIVLength   = errors.New("incorrect iv length")
	ErrBlockCipherRequired = errors.New("input block cipher cannot be nil")
	ErrKeyIndexOutOfRange  = errors.New("key index must not exceed 255")
)

Functions

This section is empty.

Types

type FrameDecryptor

type FrameDecryptor interface {
	DecryptFrame(payload []byte) ([]byte, error)
}

FrameDecryptor decrypts a reassembled media frame after RTP depacketization. Returns (nil, nil) for server-injected frames (SIF) that should be dropped.

type FrameEncryptor

type FrameEncryptor interface {
	EncryptFrame(payload []byte) ([]byte, error)
}

FrameEncryptor encrypts a complete media frame (audio or video access unit) before RTP packetization. Implementations are codec-aware: the codec is configured at construction time, not at each call.

type KeyProvider

type KeyProvider interface {
	// GetKey returns the derived AES key for the given index. It is called on every encrypt and
	// decrypt, so implementations should return pre-derived keys rather than derive on demand.
	GetKey(keyIndex uint32) ([]byte, error)
	// CurrentKeyIndex returns the active key index for encryption.
	CurrentKeyIndex() uint32
}

KeyProvider manages encryption keys for E2EE.

Jump to

Keyboard shortcuts

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