Exemple #1
0
 /// <summary>
 /// Creates a new ScsTcpServer object.
 /// </summary>
 /// <param name="endPoint">The endpoint address of the server to listen incoming connections</param>
 /// <param name="serverCert"></param>
 /// <param name="clientCerts"></param>
 /// <param name="authMode"></param>
 public ScsSslTcpServer(ScsTcpEndPoint endPoint, X509Certificate serverCert, List <X509Certificate2> clientCerts, SslScsAuthMode authMode)
 {
     _endPoint    = endPoint;
     _serverCert  = serverCert;
     _clientCerts = clientCerts;
     _authMode    = authMode;
 }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="serverEndPoint">The endpoint address to connect to the server</param>
 /// <param name="serverCertificate">The server certificate (public key only)</param>
 /// <param name="sslHostAddress">SSL Host address that will be used for authentication</param>
 /// <param name="authenticationMechanism">The used authentication mechanism</param>
 /// <param name="clientCertificate">The client certificate (public and private keys)
 /// This is optional and it is used in case of mutual authentication</param>
 public SslScsTcpClient(ScsTcpEndPoint serverEndPoint, X509Certificate2 serverCertificate
                        , string sslHostAddress
                        , SslScsAuthMode authenticationMechanism
                        , X509Certificate clientCertificate)
     : this(serverEndPoint, serverCertificate, sslHostAddress, authenticationMechanism)
 {
     _clientCertificate = clientCertificate;
 }
Exemple #3
0
 public SslScsTcpClient(ScsTcpEndPoint serverEndPoint, X509Certificate2 serverCertificate
                        , string sslHostAddress
                        , SslScsAuthMode authenticationMechanism
                        , X509Certificate clientCertificate
                        , RemoteCertificateValidationCallback validateCertificate)
     : this(serverEndPoint, serverCertificate, sslHostAddress, authenticationMechanism, clientCertificate)
 {
     _validateCertificate = validateCertificate;
 }
Exemple #4
0
 /// <summary>
 /// Creates a new ScsTcpClient object.
 /// </summary>
 /// <param name="serverEndPoint">The endpoint address to connect to the server</param>
 /// <param name="serverCertificate">The server certificate (public key only)</param>
 /// <param name="sslHostAddress">SSL Host address that will be used for authentication</param>
 /// <param name="authenticationMechanism">The used authentication mechanism</param>
 public SslScsTcpClient(ScsTcpEndPoint serverEndPoint, X509Certificate2 serverCertificate
                        , string sslHostAddress
                        , SslScsAuthMode authenticationMechanism = SslScsAuthMode.ServerAuth
                        )
 {
     _serverEndPoint             = serverEndPoint;
     _serverCertificate          = serverCertificate;
     _sslHostAddress             = sslHostAddress;
     _sslAuthenticationMechanism = authenticationMechanism;
 }
Exemple #5
0
 /// <summary>
 /// Creates a new TcpConnectionListener for given endpoint.
 /// </summary>
 /// <param name="endPoint">The endpoint address of the server to listen incoming connections</param>
 /// <param name="serverCert"></param>
 /// <param name="clientCerts"></param>
 /// <param name="authMode"></param>
 /// <param name="validationCallback"></param>
 public TcpSslConnectionListener(ScsTcpEndPoint endPoint, X509Certificate serverCert
                                 , List <X509Certificate2> clientCerts
                                 , SslScsAuthMode authMode
                                 , RemoteCertificateValidationCallback validationCallback = null)
 {
     _endPoint           = endPoint;
     _serverCertificate  = serverCert;
     _clientCertificates = clientCerts;
     _authMode           = authMode;
     _validationCallback = validationCallback;
 }
 /// <summary>
 /// SSL
 /// </summary>
 /// <param name="endPoint"></param>
 /// <param name="cert"></param>
 /// <returns></returns>
 public static IScsServer CreateSslServer(ScsEndPoint endPoint, X509Certificate serverCert, List <X509Certificate2> clientCerts, SslScsAuthMode authMode)
 {
     return(endPoint.CreateSslServer(serverCert, clientCerts, authMode));
 }
Exemple #7
0
 /// <summary>
 /// Creates a Scs Server that uses this end point to connect to server.
 /// </summary>
 /// <returns>Scs Client</returns>
 internal abstract IScsClient CreateSslClient(X509Certificate2 serverCertificate, SslScsAuthMode authMode, X509Certificate clientCertificate, string sslHostAddress);
Exemple #8
0
 /// <summary>
 /// Creates a SSL Scs Server that uses this end point to listen incoming connections.
 /// </summary>
 /// <returns>Scs Server</returns>
 internal abstract IScsServer CreateSslServer(X509Certificate serverCert, List <X509Certificate2> clientCerts, SslScsAuthMode authMode);
 /// <summary>
 /// SSL
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="serverCert"></param>
 /// <param name="clientCert"></param>
 /// <param name="nombreServerCert"></param>
 /// <param name="endpoint"></param>
 /// <param name="clientObject"></param>
 /// <returns></returns>
 public static IScsServiceClient <T> CreateSslClient <T>(ScsEndPoint endpoint, X509Certificate2 serverCert, string hostAddress, SslScsAuthMode authMode, X509Certificate2 clientCert, object clientObject = null) where T : class
 {
     return(new ScsServiceClient <T>(endpoint.CreateSslClient(serverCert, authMode, clientCert, hostAddress), clientObject));
 }
Exemple #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="endpoint"></param>
 /// <param name="serverCertificate"></param>
 /// <param name="sslHostAddress"></param>
 /// <param name="authMode"></param>
 /// <param name="clientCertificate"></param>
 /// <returns></returns>
 public static IScsClient CreateSslClient(ScsEndPoint endpoint, X509Certificate2 serverCertificate
                                          , string sslHostAddress   = ""
                                          , SslScsAuthMode authMode = SslScsAuthMode.ServerAuth, X509Certificate clientCertificate = null)
 {
     return(endpoint.CreateSslClient(serverCertificate, authMode, clientCertificate, sslHostAddress));
 }
Exemple #11
0
 internal override IScsClient CreateSslClient(X509Certificate2 serverCertificate, SslScsAuthMode authMode,
                                              X509Certificate clientCertificate, string sslHostAddress)
 {
     return(new SslScsTcpClient(this, serverCertificate, sslHostAddress, authMode, clientCertificate));
 }
Exemple #12
0
 internal override IScsServer CreateSslServer(X509Certificate serverCert, List <X509Certificate2> clientCerts, SslScsAuthMode authMode)
 {
     //this is called when the server is created
     return(new ScsSslTcpServer(this, serverCert, clientCerts, authMode));
 }
Exemple #13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="endPoint"></param>
 /// <param name="serverCert"></param>
 /// <param name="clientCerts"></param>
 /// <param name="authMode"></param>
 /// <returns></returns>
 public static IScsServiceApplication CreateSslService(ScsEndPoint endPoint, X509Certificate serverCert, List <X509Certificate2> clientCerts, SslScsAuthMode authMode)
 {
     return(new ScsServiceApplication(SslScsServerFactory.CreateSslServer(endPoint, serverCert, clientCerts, authMode)));
 }