dtls

package
v0.0.0-...-6eb22ad Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddListener

func AddListener(src string, conn *ipv4.PacketConn)

AddListener adds the socket to a map that can be accessed by OpenSSL for sending This only needed until DTLS is rewritten in native Go

func RemoveListener

func RemoveListener(src string)

RemoveListener removes the socket from a map that can be accessed by OpenSSL for sending This only needed until DTLS is rewritten in native Go

Types

type CertPair

type CertPair struct {
	ClientWriteKey []byte
	ServerWriteKey []byte
	Profile        string
}

CertPair is the client+server key and profile extracted for SRTP

type State

type State struct {
	*TLSCfg
	// contains filtered or unexported fields
}

State represents all the state needed for a DTLS session

func NewState

func NewState(tlscfg *TLSCfg, isClient bool, src, dst string) (d *State, err error)

NewState creates a new DTLS session

func (*State) Close

func (d *State) Close()

Close cleans up the associated OpenSSL resources

func (*State) DoHandshake

func (d *State) DoHandshake()

DoHandshake sends the DTLS handshake it the remote peer

func (*State) HandleDTLSPacket

func (d *State) HandleDTLSPacket(packet []byte) (certPair *CertPair)

HandleDTLSPacket checks if the packet is a DTLS packet, and if it is passes to the DTLS session

type TLSCfg

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

TLSCfg holds the Certificate/PrivateKey used for a single RTCPeerConnection

func NewTLSCfg

func NewTLSCfg() *TLSCfg

NewTLSCfg creates a new TLSCfg

func (*TLSCfg) Close

func (t *TLSCfg) Close()

Close cleans up the associated OpenSSL resources

func (*TLSCfg) Fingerprint

func (t *TLSCfg) Fingerprint() string

Fingerprint generates a SHA-256 fingerprint of the certificate

Jump to

Keyboard shortcuts

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