Error processing SSI file
LEADTOOLS Multimedia (Leadtools.MediaStreaming assembly)

Show in webframe

SSLCertificateHash Property






Retrieves or sets the server's SSL certificate hash bytes.
Syntax
public object SSLCertificateHash {get; set;}
'Declaration
 
Public Property SSLCertificateHash As Object
'Usage
 
Dim instance As NetworkProperties
Dim value As Object
 
instance.SSLCertificateHash = value
 
value = instance.SSLCertificateHash
public:
property Object^ SSLCertificateHash {
   Object^ get();
   void set (    Object^ value);
}

Property Value

The Object containing the hash data.
Remarks
The hash uniquely identifies the certificate in the store. The value is a one dimension array and should contain byte elements. A zero length byte array means that no hash is assigned.
Example

Copy Code  
Imports Leadtools
Imports Leadtools.MediaStreaming

Public _server As Server = Nothing
Public _result As Boolean = False

Public Sub SetNetworkSSLPropertiesExample()
  Try
     ' create an instance of the server object
     _server = New Leadtools.MediaStreaming.Server()

     ' retrieve a copy of the Network Properties
     Dim props As NetworkProperties = _server.GetNetworkProperties()

     Dim strStore As String = "MY"
     Dim strCertificate As String = "LEAD Media Streaming Server" ' Friendly Name of the certificate we want to find.

     ' find the certificate name in the specified store, and get the hash
     Dim hash As Byte() = Nothing

     Dim certstore As System.Security.Cryptography.X509Certificates.X509Store
     certstore = New System.Security.Cryptography.X509Certificates.X509Store(strStore, System.Security.Cryptography.X509Certificates.StoreLocation.LocalMachine)
     Dim flag As System.Security.Cryptography.X509Certificates.OpenFlags
     flag = System.Security.Cryptography.X509Certificates.OpenFlags.OpenExistingOnly Or System.Security.Cryptography.X509Certificates.OpenFlags.ReadWrite
     certstore.Open(flag)
     For Each certificate As System.Security.Cryptography.X509Certificates.X509Certificate2 In certstore.Certificates
       If certificate.FriendlyName = strCertificate Then
         hash = certificate.GetCertHash()
         Exit For
       End If
     Next certificate

     If Not hash Is Nothing AndAlso hash.Length > 0 Then
       ' change the properties

       props.SSLPort = 6968

       props.SSLCertificateStore = strStore

       props.SSLCertificateHash = hash

       ' copy the Network Properties to the server
       _server.SetNetworkProperties(props)

       _result = True
     End If
  Catch e1 As Exception
     _result = False
  End Try
End Sub
using Leadtools;
using Leadtools.MediaStreaming;

public Server _server = null;
public bool _result = false;

public void SetNetworkSSLPropertiesExample()
{
   try
   {
      // create an instance of the server object
      _server = new Leadtools.MediaStreaming.Server();

      // retrieve a copy of the Network Properties
      NetworkProperties props = _server.GetNetworkProperties();

      string strStore = "MY";
      string strCertificate = "LEAD Media Streaming Server"; // Friendly Name of the certificate we want to find.

      // find the certificate name in the specified store, and get the hash
      byte[] hash = null;

      System.Security.Cryptography.X509Certificates.X509Store certstore;
      certstore = new System.Security.Cryptography.X509Certificates.X509Store(strStore, System.Security.Cryptography.X509Certificates.StoreLocation.LocalMachine);
      System.Security.Cryptography.X509Certificates.OpenFlags flag;
      flag = System.Security.Cryptography.X509Certificates.OpenFlags.OpenExistingOnly | System.Security.Cryptography.X509Certificates.OpenFlags.ReadWrite;
      certstore.Open(flag);
      foreach (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate in certstore.Certificates)
      {
         if (certificate.FriendlyName == strCertificate)
         {
            hash = certificate.GetCertHash();
            break;
         }
      }

      if (hash != null && hash.Length > 0)
      {
         // change the properties

         props.SSLPort = 6968;

         props.SSLCertificateStore = strStore;

         props.SSLCertificateHash = hash;

         // copy the Network Properties to the server
         _server.SetNetworkProperties(props);

         _result = true;
      }
   }
   catch (Exception)
   {
      _result = false;
   }
}
Requirements

Target Platforms

See Also

Reference

NetworkProperties Class
NetworkProperties Members

Error processing SSI file
Leadtools.MediaStreaming requires a Multimedia or Multimedia Suite license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features