Compartir a través de


RTCSrtpSdesTransport object

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

**Soon to be depricated** Exposes information relating to SRTP/SDES transport [RFC4568]. Details relating to configuration of Microsoft's implementation of SRTP/SDES are described in [MS-SDPEXT].

Note  

SRTP/SDES support is forbidden by the IETF RTCWEB security specifications. To conform to this requirement, support for SRTP/SDES will be removed from Microsoft Edge in the future. Therefore, applications also need to support DTLS/SRTP so they will continue to function once SRTP/SDES support is removed.

 

Overview

An RTCSrtpSdesTransport instance is associated to an RTCRtpSender or an RTCRtpReceiver.

Operation

An RTCSrtpSdesTransport instance is constructed from an RTCIceTransport, as well as the encryption parameters (obtained from the local peer) and the decryption parameters (obtained from the remote peer). Both multiplexed and non-multiplexed RTP/RTCP are supported with RTCSrtpSdesTransport objects. If RTP and RTCP are not multiplexed, the RTP RTCIceTransport instance transport passed in the constructor is sufficient; if there is an "associated" RTCP transport rtcpTransport, it is provided implicitly. Since an RTCSrtpSdesTransport is ready to function as soon as it is created, there is no need for start() and stop() methods.

If either encryptParameters or decryptParameters contain a sequence of more than one keyParams dictionary, then keyParams.mkiValue and keyParams.mkiLength must be set to a value greater than zero for each keyParams dictionary entry or an InvalidParameters exception is thrown.

Syntax

[Constructor(RTCIceTransport transport, RTCSrtpSdesParameters encryptParameters, RTCSrtpSdesParameters decryptParameters)]
interface RTCSrtpSdesTransport {
    readonly    attribute RTCIceTransport transport;
    static sequence<RTCSrtpSdesParameters> getLocalParameters ();
                attribute EventHandler?   onerror;
};

Members

The RTCSrtpSdesTransport object has these types of members:

  • Events
  • Methods
  • Properties

Events

The RTCSrtpSdesTransport object has these events.

Event Description
onerror

Set this handler to receive RTCSrtpSdesTransport error events.

 

Methods

The RTCSrtpSdesTransport object has these methods.

Method Description
getLocalParameters

Obtain the local SRTP/SDES parameter sets.

 

Properties

The RTCSrtpSdesTransport object has these properties.

Property Access type Description

transport

Read-only

Identifies the associated RTCIceTransport instance.

 

Standards information

Examples

// This is an example of  how to offer ICE and SRTP/SDES parameters and 
// ICE candidates and get back ICE and SRTP/SDES parameters and ICE candidates,
// and start both ICE and SRTP/SDES, when RTP and RTCP are multiplexed. 
// Assume that we have a way to signal (mySignaller). 
// Include some helper functions
import "helper.js";
function initiate(mySignaller) {
  // Prepare the ICE gatherer
  var gatherOptions = new RTCIceGatherOptions();
  gatherOptions.gatherPolicy = RTCIceGatherPolicy.all; 
  gatherOptions.iceservers = [ { urls: "stun:stun1.example.net" } , { urls:"turn:turn.example.org", username: "user", credential:"myPassword"} ]; 
  var iceGatherer = new RTCIceGatherer(gatherOptions); 
  iceGatherer.onlocalcandidate = function(event) {
    mySignaller.mySendLocalCandidate(event.candidate);
  }; 
  // Create ICE transport
  var ice = new RTCIceTransport();
  // Get SRTP/SDES encryption parameters
  var encryptParams = RTCSrtpSdesTransport.getLocalParameters(); 
  // Prepare to handle remote ICE candidates
  mySignaller.onRemoteCandidate = function(candidate){
   ice.addRemoteCandidate(candidate);
  }
  // ... create RtpSender/RtpReceiver objects as illustrated in Section 7.5 Example 9

  mySignaller.mySendInitiate({
    "ice": iceGatherer.getLocalParameters(),
    "srtpsdes": encryptParams, 
    // ... include RTP info from other example
  }, function(remote) {
    // Start the ICE transport
    ice.start(iceGatherer, remote.ice, RTCIceRole.controlling);
    // Construct the SRTP/SDES transport (which auto-starts)
    var srtpsdes = new RTCSrtpSdesTransport(ice, encryptParams, remote.srtpsdes);  
    // ... configure RtpSender/RtpReceiver objects as illustrated in Section 7.5 Example 9
  });
}

// This is an example of how to answer with ICE and SRTP/SDES
// parameters and ICE candidates and start both ICE and SRTP/SDES, 
// assuming that RTP and RTCP are multiplexed.
// Include some helper functions
import "helper.js";
// Assume that remote info is signalled to us. 
function accept(mySignaller, remote) {
  var gatherOptions = new RTCIceGatherOptions();
  gatherOptions.gatherPolicy = RTCIceGatherPolicy.all;
  gatherOptions.iceservers = [ { urls: "stun:stun1.example.net" } , { urls:"turn:turn.example.org", username: "user", credential:"myPassword"} ] ;
  var iceGatherer = new RTCIceGatherer(gatherOptions);
  iceGatherer.onlocalcandidate = function(event) {
    mySignaller.mySendLocalCandidate(event.candidate);
  };
  // Create ICE transport
  var ice = new RTCIceTransport();
  // Get SRTP/SDES encryption parameters
  var encryptParams = RTCSrtpSdesTransport.getLocalParameters();
  // Prepare to handle remote ICE candidates
  mySignaller.onRemoteCandidate = function(candidate){
    ice.addRemoteCandidate(candidate);
  }
  // ... create RtpSender/RtpReceiver objects as illustrated in Section 7.5 Example 9. 

  mySignaller.mySendAccept({
    "ice": iceGatherer.getLocalParameters(),
    "srtpsdes": encryptParams, 
    // ... marshall RtpSender/RtpReceiver capabilities as illustrated in Section 7.5 Example 9. 
  });
  // Start the ICE transport with an implicit gather policy of "all"
  ice.start(iceGatherer, remote.ice, RTCIceRole.controlled);
    // Construct the SRTP/SDES transport (which auto-starts)
    var srtpsdes = new RTCSrtpSdesTransport(ice, encryptParams, remote.srtpsdes);
  // ... configure RtpSender/RtpReceiver objects as illustrated in Section 7.5 Example 9. 
}