• Articles
  • Api Documentation
Search Results for

    Show / Hide Table of Contents
    • SipLib.Body
      • BodyParser
      • ContentTypes
      • MessageContentsContainer
      • MultipartBinaryBodyBuilder
      • SipBodyBuilder
    • SipLib.Channels
      • AcceptCertificateDelegate
      • AcceptConnectionDelegate
      • DscpSettings
      • LogInvalidSipMessageDelegate
      • LogSipRequestDelegate
      • LogSipResponseDelegate
      • Qos
      • SIPChannel
      • SIPConnection
      • SIPConnectionDisconnectedDelegate
      • SIPConnectionsEnum
      • SIPMessageReceivedDelegate
      • SIPTCPChannel
      • SIPTLSChannel
      • SIPUDPChannel
      • SipConnectionFailedDelegate
      • SipRequestReceivedDelegate
      • SipResponseReceivedDelegate
      • SipTransactionCompleteDelegate
      • WindowsQos
    • SipLib.Collections
      • ThreadSafeGenericList<T>
    • SipLib.Core
      • ByteBufferInfo
      • CallProperties
      • Crypto
      • HTTPDigest
      • IPSocket
      • SIPAuthenticationHeader
      • SIPAuthorisationDigest
      • SIPAuthorisationHeadersEnum
      • SIPCallInfoHeader
      • SIPConstants
      • SIPContactHeader
      • SIPEndPoint
      • SIPEscape
      • SIPFrag
      • SIPFromHeader
      • SIPGeolocationHeader
      • SIPHeader
      • SIPHeaders
      • SIPMessage
      • SIPMessageTypesEnum
      • SIPMethods
      • SIPMethodsEnum
      • SIPPaiHeader
      • SIPParameters
      • SIPPpiHeader
      • SIPProtocolsEnum
      • SIPProtocolsType
      • SIPReplacesParameter
      • SIPRequest
      • SIPResponse
      • SIPResponseStatusCodes
      • SIPResponseStatusCodesEnum
      • SIPRoute
      • SIPRouteSet
      • SIPSchemesEnum
      • SIPSchemesType
      • SIPToHeader
      • SIPURI
      • SIPUserField
      • SIPValidationException
      • SIPValidationFieldsEnum
      • SIPViaHeader
      • SIPViaSet
      • SipUtils
      • TypeExtensions
    • SipLib.Dtls
      • AlertLevelsEnum
      • AlertTypesEnum
      • DtlsClientUdpTransport
      • DtlsServerUdpTransport
      • DtlsSrtpClient
      • DtlsSrtpServer
      • DtlsSrtpTransport
      • DtlsUtils
      • IDtlsSrtpPeer
      • IPacketTransformer
      • ITransformEngine
      • NetConvert
      • RTCDtlsFingerprint
      • RawPacket
      • SrtcpCryptoContext
      • SrtpPolicy
      • SrtpTransformEngine
      • SrtpTransformer
    • SipLib.Logging
      • SipLogger
    • SipLib.Media
      • ALawDecoder
      • ALawEncoder
      • AudioDestination
      • AudioDestinationDelegate
      • AudioSampleData
      • AudioSamplesReadyDelegate
      • AudioSource
      • Band
      • DtmfDigitReceivedDelegate
      • FileAudioSource
      • G722Codec
      • G722CodecState
      • G722Decoder
      • G722Encoder
      • G722Flags
      • HighResolutionTimer
      • HighResolutionTimerDelegate
      • IAudioDecoder
      • IAudioEncoder
      • IAudioSampleSource
      • MediaPortManager
      • MediaPortSettings
      • MediaTypes
      • MsrpEncryptionEnum
      • MuLawDecoder
      • MuLawEncoder
      • PcmaDecoder
      • PcmaEncoder
      • PcmuDecoder
      • PcmuEncoder
      • PortRange
      • RtpEncryptionEnum
    • SipLib.Msrp
      • ByteRangeHeader
      • CpimMessage
      • MsrpCompletionStatus
      • MsrpConnection
      • MsrpConnectionStatusDelegate
      • MsrpMessage
      • MsrpMessageDeliveryFailedDelegate
      • MsrpMessageReceivedDelegate
      • MsrpMessageSentDelegate
      • MsrpMessageType
      • MsrpPathHeader
      • MsrpStatusHeader
      • MsrpStreamParser
      • MsrpTextMessageReceivedDelegate
      • MsrpUri
      • ReportReceivedDelegate
    • SipLib.Network
      • IpUtils
    • SipLib.RealTimeText
      • RttCharactersReceivedDelegate
      • RttParameters
      • RttReceiver
      • RttRtpSendDelegate
      • RttSender
    • SipLib.Rtp
      • ByePacket
      • DtlsHandshakeFailedDelegate
      • DtmfEventEnum
      • DtmfPacket
      • JitterStatistics
      • MeanOpinionScore
      • ReceiveStatisticsReadyDelegate
      • ReceiverReport
      • ReportBlock
      • RtcpCompoundPacket
      • RtcpHeader
      • RtcpPacketReceivedDelegate
      • RtcpPacketSentDelegate
      • RtcpPacketType
      • RtpChannel
      • RtpPacket
      • RtpPacketReceivedDelegate
      • RtpPacketSentDelegate
      • RtpReceiveStatistics
      • RtpUtils
      • SdesChunk
      • SdesItem
      • SdesItemType
      • SdesPacket
      • SenderInfo
      • SenderReport
    • SipLib.RtpCrypto
      • AesFunctions
      • CryptoAttribute
      • CryptoContext
      • CryptoSuites
      • InlineParams
      • MasterKeys
      • RocVals
      • RocValues
      • SRtpErrorsEnum
      • SRtpUtils
      • SessionKeys
      • SrtpDecryptor
      • SrtpEncryptor
      • SrtpLabelItem
      • SrtpTransformBase
    • SipLib.Sdp
      • ConnectionData
      • MediaDescription
      • MediaDirectionEnum
      • Origin
      • RtpMapAttribute
      • Sdp
      • SdpAnswerSettings
      • SdpAttribute
      • SdpUtils
      • SetupType
    • SipLib.Threading
      • QueuedActionWorkerTask
    • SipLib.Transactions
      • ClientInviteTransaction
      • ClientNonInviteTransaction
      • ServerInviteTransaction
      • ServerNonInviteTransaction
      • SipTimers
      • SipTransactionBase
      • SipTransport
      • TransactionRequestReceivedDelegate
      • TransactionResponseReceivedDelegate
      • TransactionStateEnum
      • TransactionTerminationReasonEnum
    • SipLib.Video
      • H264Depacketiser
      • H264Packetiser
      • H264Packetiser.H264Nal
      • H264RtpReceiver
      • H264RtpSender
      • RtpSendDelegate
      • RtpVP8Header
      • VP8RtpReceiver
      • VP8RtpSender
      • VideoRtpReceiver
      • VideoRtpSender

    Class DtlsSrtpTransport

    Class for managing the transport logic for a DTLS SRTP client or a server.

    Inheritance
    object
    DtlsSrtpTransport
    Implements
    DatagramTransport
    TlsCloseable
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: SipLib.Dtls
    Assembly: SipLib.dll
    Syntax
    public class DtlsSrtpTransport : DatagramTransport, TlsCloseable, IDisposable

    Constructors

    | Edit this page View Source

    DtlsSrtpTransport(IDtlsSrtpPeer, int)

    Constructor

    Declaration
    public DtlsSrtpTransport(IDtlsSrtpPeer connection, int mtu = 1500)
    Parameters
    Type Name Description
    IDtlsSrtpPeer connection

    A DtlsSrtpClient object or a DtlsSrtpServer object that this transport object will manage

    int mtu

    Maximum transfer unit for the network. Defaults to 1500.

    Fields

    | Edit this page View Source

    OnDataReady

    Event that is fired when there is data that needs to be sent via UDP

    Declaration
    public Action<byte[]>? OnDataReady
    Field Value
    Type Description
    Action<byte[]>
    | Edit this page View Source

    RetransmissionMilliseconds

    Sets the period in milliseconds that receive will wait before try retransmission

    Declaration
    public int RetransmissionMilliseconds
    Field Value
    Type Description
    int
    | Edit this page View Source

    TimeoutMilliseconds

    Sets the period in milliseconds that the handshake attempt will timeout after.

    Declaration
    public int TimeoutMilliseconds
    Field Value
    Type Description
    int

    Properties

    | Edit this page View Source

    IsClient

    Returns true if this transport object is for a DTLS client or false if its for a DTLS server.

    Declaration
    public bool IsClient { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    SrtcpDecoder

    Gets the SRTCP decoder

    Declaration
    public IPacketTransformer SrtcpDecoder { get; }
    Property Value
    Type Description
    IPacketTransformer
    | Edit this page View Source

    SrtcpEncoder

    Gets the SRTCP decoder

    Declaration
    public IPacketTransformer SrtcpEncoder { get; }
    Property Value
    Type Description
    IPacketTransformer
    | Edit this page View Source

    SrtpDecoder

    Gets the SRTP decoder

    Declaration
    public IPacketTransformer SrtpDecoder { get; }
    Property Value
    Type Description
    IPacketTransformer
    | Edit this page View Source

    SrtpEncoder

    Gets the SRTP encoder

    Declaration
    public IPacketTransformer SrtpEncoder { get; }
    Property Value
    Type Description
    IPacketTransformer
    | Edit this page View Source

    Transport

    Gets or sets the DTLS transport object

    Declaration
    public DtlsTransport? Transport { get; }
    Property Value
    Type Description
    DtlsTransport

    Methods

    | Edit this page View Source

    BackOff(int)

    Handle retransmission time based in DTLS 1.3

    Declaration
    protected virtual int BackOff(int currentWaitMillis)
    Parameters
    Type Name Description
    int currentWaitMillis
    Returns
    Type Description
    int
    | Edit this page View Source

    Close()

    Closes this transport object.

    Declaration
    public virtual void Close()
    | Edit this page View Source

    Dispose()

    Close the transport if the instance is out of scope.

    Declaration
    public void Dispose()
    | Edit this page View Source

    Dispose(bool)

    Close the transport if the instance is out of scope.

    Declaration
    protected void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    | Edit this page View Source

    DoHandshake(out string?)

    Starts the DTLS handshake as a client or as a server. This method blocks until the handshake is complete.

    Declaration
    public bool DoHandshake(out string? handshakeError)
    Parameters
    Type Name Description
    string handshakeError

    Set to a string that describes the handshake error. Set to null if no errors occurred. Will be non-null if this method returns false.

    Returns
    Type Description
    bool

    Returns true if successful or false if a handshake error occurred.

    | Edit this page View Source

    GenerateRtcpDecoder()

    Generates an IPacketTransformer interface to use to decode RTCP packets

    Declaration
    protected IPacketTransformer GenerateRtcpDecoder()
    Returns
    Type Description
    IPacketTransformer
    | Edit this page View Source

    GenerateRtcpEncoder()

    Generates an IPacketTransformer interface to use to encode RTCP packets

    Declaration
    protected IPacketTransformer GenerateRtcpEncoder()
    Returns
    Type Description
    IPacketTransformer
    | Edit this page View Source

    GenerateRtpDecoder()

    Generates an IPacketTransformer interface to use to decode RTP packets

    Declaration
    protected IPacketTransformer GenerateRtpDecoder()
    Returns
    Type Description
    IPacketTransformer
    | Edit this page View Source

    GenerateRtpEncoder()

    Generates an IPacketTransformer interface to use to encode RTP packets

    Declaration
    protected IPacketTransformer GenerateRtpEncoder()
    Returns
    Type Description
    IPacketTransformer
    | Edit this page View Source

    GenerateTransformer(bool, bool)

    Generates an IPacketTransformer for a DTLS client or server for RTP or RTCP packets

    Declaration
    protected IPacketTransformer GenerateTransformer(bool isClient, bool isRtp)
    Parameters
    Type Name Description
    bool isClient

    Set to true to generate the transformer for the client or false to generate the transformer for the server.

    bool isRtp

    Set to true to generate the transformer for RTP packets or to false to generate the transformer for RTCP packets

    Returns
    Type Description
    IPacketTransformer
    | Edit this page View Source

    GetMasterClientKey()

    Gets the client's master key

    Declaration
    protected byte[] GetMasterClientKey()
    Returns
    Type Description
    byte[]
    | Edit this page View Source

    GetMasterClientSalt()

    Gets the client's master salt

    Declaration
    protected byte[] GetMasterClientSalt()
    Returns
    Type Description
    byte[]
    | Edit this page View Source

    GetMasterServerKey()

    Gets the server's master key

    Declaration
    protected byte[] GetMasterServerKey()
    Returns
    Type Description
    byte[]
    | Edit this page View Source

    GetMasterServerSalt()

    Gets the server's master salt

    Declaration
    protected byte[] GetMasterServerSalt()
    Returns
    Type Description
    byte[]
    | Edit this page View Source

    GetReceiveLimit()

    Returns the maximum number of bytes that can be received

    Declaration
    public int GetReceiveLimit()
    Returns
    Type Description
    int
    | Edit this page View Source

    GetRemoteCertificate()

    Gets the X.509 certificate of the remote peer

    Declaration
    public Certificate GetRemoteCertificate()
    Returns
    Type Description
    Certificate
    | Edit this page View Source

    GetSendLimit()

    Returns the maximum number of bytes that can be sent

    Declaration
    public int GetSendLimit()
    Returns
    Type Description
    int
    | Edit this page View Source

    GetSrtcpPolicy()

    Gets the SRTCP encryption and authenticaion policy information for the DTLS-SRTP session

    Declaration
    protected SrtpPolicy GetSrtcpPolicy()
    Returns
    Type Description
    SrtpPolicy
    | Edit this page View Source

    GetSrtpPolicy()

    Gets the SRTCP encryption and authenticaion policy information for the DTLS-SRTP session

    Declaration
    protected SrtpPolicy GetSrtpPolicy()
    Returns
    Type Description
    SrtpPolicy
    | Edit this page View Source

    IsHandshakeComplete()

    Returns true if the DTLS handshake is complete or false if it is not

    Declaration
    public bool IsHandshakeComplete()
    Returns
    Type Description
    bool
    | Edit this page View Source

    IsHandshakeFailed()

    Returns true if the DTLS hanshake failed or false if it did not

    Declaration
    public bool IsHandshakeFailed()
    Returns
    Type Description
    bool
    | Edit this page View Source

    IsHandshaking()

    Returns true if the DTLS handshake is in progress

    Declaration
    public bool IsHandshaking()
    Returns
    Type Description
    bool
    | Edit this page View Source

    ProtectRTCP(byte[], int, int)

    Protects (encrypts) a compete RTCP packet

    Declaration
    public byte[] ProtectRTCP(byte[] packet, int offset, int length)
    Parameters
    Type Name Description
    byte[] packet

    The complete RTCP packet to protect

    int offset

    Offset to the RTCP packet

    int length

    Number of bytes in the RTCP packet

    Returns
    Type Description
    byte[]

    Returns the encrypted RTCP packet

    | Edit this page View Source

    ProtectRTP(byte[], int, int)

    Protects (encrypts) a complete RTP packet.

    Declaration
    public byte[] ProtectRTP(byte[] packet, int offset, int length)
    Parameters
    Type Name Description
    byte[] packet

    Complete RTP packet to encrypt

    int offset

    Offset to the RTP packet

    int length

    Number of bytes in the RTP packet

    Returns
    Type Description
    byte[]

    Returns the encrypted RTP packet

    | Edit this page View Source

    Receive(byte[], int, int, int)

    Implementation of the ReciveMethod of the BouncyCastle DatagramTransport interface. Users of the DtlsSrtpTransport class must not call this method.

    Declaration
    public int Receive(byte[] buf, int off, int len, int waitMillis)
    Parameters
    Type Name Description
    byte[] buf
    int off
    int len
    int waitMillis
    Returns
    Type Description
    int
    | Edit this page View Source

    Send(byte[], int, int)

    Implementation of the Send() method of the BouncyCastle DatagramTransport interface. Users of the DtlsSrtpTransport class must not call this method.

    Declaration
    public void Send(byte[] buf, int off, int len)
    Parameters
    Type Name Description
    byte[] buf
    int off
    int len
    | Edit this page View Source

    UnprotectRTCP(byte[], int, int)

    Unprotects (decrypts) a complete RTCP packet

    Declaration
    public byte[] UnprotectRTCP(byte[] packet, int offset, int length)
    Parameters
    Type Name Description
    byte[] packet

    Complete RTCP packet to decrypt

    int offset

    Offset to the RTCP packet

    int length

    Number of bytes in the RTCP packet

    Returns
    Type Description
    byte[]

    Returns the decrypted RTCP packet

    | Edit this page View Source

    UnprotectRTP(byte[], int, int)

    Unprotects (decrypts) an RTP packet received from the remote endpoint. Only call this method if IsHandshake() complete returns true and IsHandshakeFailed() returns false

    Declaration
    public byte[] UnprotectRTP(byte[] packet, int offset, int length)
    Parameters
    Type Name Description
    byte[] packet

    Complete RTP packet that was receivedincluding the RTP header

    int offset

    Offset into the input of the RTP packet

    int length

    Number of bytes in the RTP packet

    Returns
    Type Description
    byte[]
    | Edit this page View Source

    WriteToRecvStream(byte[])

    Call this method to send a UDP packet that has been received from the network to the receive stream of the DTLS handshake logic. Only call this method if the DTLS handshake has not been completed.

    Declaration
    public void WriteToRecvStream(byte[] buf)
    Parameters
    Type Name Description
    byte[] buf

    The UDP packet that was received from the network.

    Events

    | Edit this page View Source

    OnAlert

    Event that is fired if a DTlS protocol Alert occurs

    Declaration
    public event Action<AlertLevelsEnum, AlertTypesEnum, string>? OnAlert
    Event Type
    Type Description
    Action<AlertLevelsEnum, AlertTypesEnum, string>

    Implements

    Org.BouncyCastle.Crypto.Tls.DatagramTransport
    Org.BouncyCastle.Crypto.Tls.TlsCloseable
    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX