dtls

package
v1.9.14 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const CipherSuiteID_CCAC dtls.CipherSuiteID = 0xCCAC

Variables

This section is empty.

Functions

func CalculateAuthKey

func CalculateAuthKey(enr, mac string) []byte

func CustomCipherSuites

func CustomCipherSuites() []dtls.CipherSuite

func DerivePSK

func DerivePSK(enr string) []byte

func NewDTLSClient

func NewDTLSClient(ctx context.Context, channel uint8, addr net.Addr, writeFn func([]byte, uint8) error, readChan chan []byte, psk []byte) (*dtls.Conn, error)

func NewDTLSServer

func NewDTLSServer(ctx context.Context, channel uint8, addr net.Addr, writeFn func([]byte, uint8) error, readChan chan []byte, psk []byte) (*dtls.Conn, error)

Types

type ChaCha20Poly1305Cipher

type ChaCha20Poly1305Cipher struct {
	// contains filtered or unexported fields
}

func NewChaCha20Poly1305Cipher

func NewChaCha20Poly1305Cipher(localKey, localWriteIV, remoteKey, remoteWriteIV []byte) (*ChaCha20Poly1305Cipher, error)

func (*ChaCha20Poly1305Cipher) Decrypt

func (c *ChaCha20Poly1305Cipher) Decrypt(header recordlayer.Header, in []byte) ([]byte, error)

func (*ChaCha20Poly1305Cipher) Encrypt

func (c *ChaCha20Poly1305Cipher) Encrypt(pkt *recordlayer.RecordLayer, raw []byte) ([]byte, error)

type DTLSConn

type DTLSConn struct {
	// contains filtered or unexported fields
}

func DialDTLS

func DialDTLS(host string, port int, uid, authKey, enr string, verbose bool) (*DTLSConn, error)

func (*DTLSConn) AVClientStart

func (c *DTLSConn) AVClientStart(timeout time.Duration) error

func (*DTLSConn) AVRecvFrameData

func (c *DTLSConn) AVRecvFrameData() (*tutk.Packet, error)

func (*DTLSConn) AVSendAudioData

func (c *DTLSConn) AVSendAudioData(codec byte, payload []byte, timestampUS uint32, sampleRate uint32, channels uint8) error

func (*DTLSConn) AVServStart

func (c *DTLSConn) AVServStart() error

func (*DTLSConn) AVServStop

func (c *DTLSConn) AVServStop() error

func (*DTLSConn) Close

func (c *DTLSConn) Close() error

func (*DTLSConn) Error

func (c *DTLSConn) Error() error

func (*DTLSConn) HasTwoWayStreaming

func (c *DTLSConn) HasTwoWayStreaming() bool

func (*DTLSConn) IsBackchannelReady

func (c *DTLSConn) IsBackchannelReady() bool

func (*DTLSConn) LocalAddr

func (c *DTLSConn) LocalAddr() *net.UDPAddr

func (*DTLSConn) RemoteAddr

func (c *DTLSConn) RemoteAddr() *net.UDPAddr

func (*DTLSConn) SetDeadline

func (c *DTLSConn) SetDeadline(t time.Time) error

func (*DTLSConn) Write

func (c *DTLSConn) Write(data []byte) error

func (*DTLSConn) WriteAndWait

func (c *DTLSConn) WriteAndWait(req []byte, ok func(res []byte) bool) ([]byte, error)

func (*DTLSConn) WriteAndWaitIOCtrl

func (c *DTLSConn) WriteAndWaitIOCtrl(payload []byte, match func([]byte) bool, timeout time.Duration) ([]byte, error)

func (*DTLSConn) WriteDTLS

func (c *DTLSConn) WriteDTLS(payload []byte, channel byte) error

func (*DTLSConn) WriteIOCtrl

func (c *DTLSConn) WriteIOCtrl(payload []byte) error

type TLSEcdhePskWithChacha20Poly1305Sha256

type TLSEcdhePskWithChacha20Poly1305Sha256 struct {
	// contains filtered or unexported fields
}

func NewTLSEcdhePskWithChacha20Poly1305Sha256

func NewTLSEcdhePskWithChacha20Poly1305Sha256() *TLSEcdhePskWithChacha20Poly1305Sha256

func (*TLSEcdhePskWithChacha20Poly1305Sha256) AuthenticationType

func (*TLSEcdhePskWithChacha20Poly1305Sha256) CertificateType

func (*TLSEcdhePskWithChacha20Poly1305Sha256) Decrypt

func (*TLSEcdhePskWithChacha20Poly1305Sha256) ECC

func (*TLSEcdhePskWithChacha20Poly1305Sha256) Encrypt

func (*TLSEcdhePskWithChacha20Poly1305Sha256) HashFunc

func (c *TLSEcdhePskWithChacha20Poly1305Sha256) HashFunc() func() hash.Hash

func (*TLSEcdhePskWithChacha20Poly1305Sha256) ID

func (*TLSEcdhePskWithChacha20Poly1305Sha256) Init

func (c *TLSEcdhePskWithChacha20Poly1305Sha256) Init(masterSecret, clientRandom, serverRandom []byte, isClient bool) error

func (*TLSEcdhePskWithChacha20Poly1305Sha256) IsInitialized

func (c *TLSEcdhePskWithChacha20Poly1305Sha256) IsInitialized() bool

func (*TLSEcdhePskWithChacha20Poly1305Sha256) KeyExchangeAlgorithm

func (*TLSEcdhePskWithChacha20Poly1305Sha256) String

Jump to

Keyboard shortcuts

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