Documentation
¶
Index ¶
Constants ¶
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 ¶
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 ¶
FrameDecryptor decrypts a reassembled media frame after RTP depacketization. Returns (nil, nil) for server-injected frames (SIF) that should be dropped.
type FrameEncryptor ¶
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.