public static byte[] CreateUseSrtpExtension(UseSrtpData useSrtpData)
        {
            if (useSrtpData == null)
            {
                throw new ArgumentNullException("useSrtpData");
            }

            MemoryStream buf = new MemoryStream();

            // SRTPProtectionProfiles
            TlsUtilities.WriteUint16ArrayWithUint16Length(useSrtpData.ProtectionProfiles, buf);

            // srtp_mki
            TlsUtilities.WriteOpaque8(useSrtpData.Mki, buf);

            return(buf.ToArray());
        }
 public static void AddUseSrtpExtension(IDictionary extensions, UseSrtpData useSRTPData)
 {
     extensions[ExtensionType.use_srtp] = CreateUseSrtpExtension(useSRTPData);
 }