public SecureTcpServer(int listenPort, X509Certificate serverCertificate,
            SecureConnectionResultsCallback callback,
            RemoteCertificateValidationCallback certValidationCallback)
        {
            if (listenPort < 0 || listenPort > UInt16.MaxValue)
                throw new ArgumentOutOfRangeException("listenPort");

            if (serverCertificate == null)
                throw new ArgumentNullException("serverCertificate");

            if (callback == null)
                throw new ArgumentNullException("callback");

            onAcceptConnection = new AsyncCallback(OnAcceptConnection);
            onAuthenticateAsServer = new AsyncCallback(OnAuthenticateAsServer);

            this.serverCert = serverCertificate;
            this.certValidationCallback = certValidationCallback;
            this.connectionCallback = callback;
            this.listenPort = listenPort;
            this.disposed = 0;
            this.checkCertifcateRevocation = false;
            this.clientCertificateRequired = false;
            this.sslProtocols = SslProtocols.Default;
        }
        public SecureTcpServer(int listenPort, X509Certificate serverCertificate, SecureConnectionResultsCallback callback, RemoteCertificateValidationCallback certValidationCallback)
        {
            if (listenPort < 0 || listenPort > UInt16.MaxValue)
            {
                throw new ArgumentOutOfRangeException("listenPort");
            }
            if (serverCertificate == null)
            {
                throw new ArgumentNullException("serverCertificate");
            }
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            onAcceptConnection          = new AsyncCallback(OnAcceptConnection);
            onAuthenticateAsServer      = new AsyncCallback(OnAuthenticateAsServer);
            this.serverCert             = serverCertificate;
            this.certValidationCallback = certValidationCallback;
            this.connectionCallback     = callback;
            this.listenPort             = listenPort;
            this.disposed = 0;
            this.checkCertifcateRevocation = false;
            this.clientCertificateRequired = false;
            this.sslProtocols = SslProtocols.Default;
        }
 public SecureTcpServer(
     int listenPort,
     X509Certificate serverCertificate,
     SecureConnectionResultsCallback callback)
     : this(listenPort, serverCertificate, callback, (RemoteCertificateValidationCallback)null)
 {
 }
        public SecureTcpClient(SecureConnectionResultsCallback callback,


                               RemoteCertificateValidationCallback certValidationCallback,


                               SslProtocols sslProtocols)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }



            onConnected = new AsyncCallback(OnConnected);


            onAuthenticateAsClient = new AsyncCallback(OnAuthenticateAsClient);



            this.certValidationCallback = certValidationCallback;


            this.connectionCallback = callback;


            protocols = sslProtocols;


            this.disposed = 0;
        }
        public SecureTcpClient(SecureConnectionResultsCallback callback,


                               RemoteCertificateValidationCallback certValidationCallback)


            : this(callback, certValidationCallback, SslProtocols.Default)
        {
        }
示例#6
0
        public SecureTcpServer(int listenPort, X509Certificate serverCertificate, SecureConnectionResultsCallback callback, RemoteCertificateValidationCallback certValidationCallback)
        {
            if (listenPort < 0 || listenPort > UInt16.MaxValue) throw new ArgumentOutOfRangeException("listenPort");
            if (serverCertificate == null) throw new ArgumentNullException("serverCertificate");
            if (callback == null) throw new ArgumentNullException("callback");

            this._ServerCertificate = serverCertificate;
            this._CertValidationCallback = certValidationCallback;
            this._ConnectionCallback = callback;
            this._ListenPort = listenPort;
            this._CheckCertifcateRevocation = false;
            this._ClientCertificateRequired = false;
            this._SslProtocols = SslProtocols.Default;
        }
        public SecureTcpClient(SecureConnectionResultsCallback callback,
            RemoteCertificateValidationCallback certValidationCallback,
            SslProtocols sslProtocols)
        {
            if (callback == null)
                throw new ArgumentNullException("callback");

            onConnected = new AsyncCallback(OnConnected);

            onAuthenticateAsClient = new AsyncCallback(OnAuthenticateAsClient);

            this.certValidationCallback = certValidationCallback;

            this.connectionCallback = callback;

            protocols = sslProtocols;

            this.disposed = 0;
        }
        public SecureTcpServer(int listenPort, X509Certificate serverCertificate, SecureConnectionResultsCallback callback, RemoteCertificateValidationCallback certValidationCallback)
        {
            if (listenPort < 0 || listenPort > UInt16.MaxValue)
            {
                throw new ArgumentOutOfRangeException("listenPort");
            }
            if (serverCertificate == null)
            {
                throw new ArgumentNullException("serverCertificate");
            }
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            this._ServerCertificate         = serverCertificate;
            this._CertValidationCallback    = certValidationCallback;
            this._ConnectionCallback        = callback;
            this._ListenPort                = listenPort;
            this._CheckCertifcateRevocation = false;
            this._ClientCertificateRequired = false;
            this._SslProtocols              = SslProtocols.Default;
        }
 public SecureTcpServer(int listenPort, X509Certificate serverCertificate,
     SecureConnectionResultsCallback callback)
     : this(listenPort, serverCertificate, callback, null)
 {
 }
 public SecureTcpClient(SecureConnectionResultsCallback callback,
     RemoteCertificateValidationCallback certValidationCallback)
     : this(callback, certValidationCallback, SslProtocols.Default)
 {
 }
 public SecureTcpClient(SecureConnectionResultsCallback callback)
     : this(callback, null, SslProtocols.Default)
 {
 }
        public SecureTcpClient(SecureConnectionResultsCallback callback)


            : this(callback, null, SslProtocols.Default)
        {
        }