←Select platform

RTSPSecurity Class

Summary

This RTSPSecurity class is used for implementing security in the RTSP server.

Syntax

C#
VB
C++
public class RTSPSecurity : IDisposable 
Public Class RTSPSecurity  
   Implements System.IDisposable  
public ref class RTSPSecurity : public System.IDisposable   

Remarks

RTSP Servers use security that is similar to that used in HTML servers and is based on authentication. The authentication methods rely on the server specifying a username and a password pair with the right to access a certain Media file.

There are two authentication methods:

  • Basic - In the Basic authentication method, the RTSP client sends the server an encrypted version of the username and password. If these match, the server grants access, otherwise it denies access.
  • Digest - In the Digest authentication method, the RTSP client generates an encrypted string from the username and password and sends it to the server. The server generates the same string from the username and password that it has and grants access if the string sent by the client matches the string generated by the server. This is a more secure method, since the username and password are never sent to the server.

From a performance standpoint, the two authentication methods have roughly the same speed. So the method you choose depends on how secure you want your server to be and in what kind of authentication is supported in your client.

The LEAD RTSP Server supports both authentication methods.

Authentication is optional, you do not need to use it unless your application requires it.

If you don't do anything, the server will not restrict access.

To implement security, you create a RTSPSecurity object and set it to the RTSPServer object using RTSPServer.SetSecurity The RTSPServer object keeps a reference to the actual RTSPSecurity object, so if you add/remove users to the RTSPSecurity object after you set it to the RTSPServer object, these changes will be reflected in the security settings for that RTSPServer instance.

To implement different security settings for each file, you create a different RTSPSecurity object for each session.

To use the same security settings for all the files, you can create one RTSPSecurity object and use it for every session you create.

In general, you need to do the following:

  1. Create an RTSPSecurity object.
  2. Specify the desired authentication method by setting the AuthenticationRequired property.
  3. Specify the name of your realm by setting the RealmName property.
  4. Add the authorized users with the AddUser method.
  5. Set the RTSPSecurity object to the session using RTSPServer.SetSecurity.
Example

C#
VB
using Leadtools; 
using Leadtools.Multimedia; 
using LeadtoolsMultimediaExamples.Fixtures; 
 
public void SetSecurity() 
{ 
   RTSPSecurity security = new RTSPSecurity(); 
   security.RealmName = "MyRTSPServer"; 
   security.AuthenticationRequired = RTSPAuthenticationType.Basic; 
   security.AddUser("TestUser", "TestPassword"); 
   _server.SetSecurity(-1, security); 
} 
Imports Leadtools 
Imports Leadtools.Multimedia 
Imports LeadtoolsMultimediaExamples.Fixtures 
 
Public Sub SetSecurity() 
   Dim security As RTSPSecurity = New RTSPSecurity() 
   security.RealmName = "MyRTSPServer" 
   security.AuthenticationRequired = RTSPAuthenticationType.Basic 
   security.AddUser("TestUser", "TestPassword") 
   _server.SetSecurity(-1, security) 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Multimedia Assembly