public override IProviderTransportContext Copy()
        {
            TransportContext copy = new SecureTransportContext();

            this.CopyInto(copy);
            return(copy);
        }
        protected override void CopyInto(TransportContext copy)
        {
            SecureTransportContext stcCopy = copy as SecureTransportContext;

            // Copy Secure properties.

            // copy keystore properties
            stcCopy.KeyStoreName     = this.KeyStoreName;
            stcCopy.KeyStorePassword = this.KeyStorePassword;
            stcCopy.KeyStoreLocation = this.KeyStoreLocation;

            // copy certificate properties
            stcCopy.AcceptInvalidBrokerCert = this.AcceptInvalidBrokerCert;
            stcCopy.ServerName         = this.ServerName;
            stcCopy.ClientCertFileName = this.ClientCertFileName;
            stcCopy.ClientCertPassword = this.ClientCertPassword;
            stcCopy.ClientCertSubject  = this.ClientCertSubject;

            // copy application callback
            stcCopy.ServerCertificateValidateCallback = this.ServerCertificateValidateCallback;
            stcCopy.ClientCertificateSelectCallback   = this.ClientCertificateSelectCallback;

            base.CopyInto(copy);

            stcCopy.connectionBuilder.SSL.RemoteCertificateValidationCallback = this.ContextServerCertificateValidation;
            stcCopy.connectionBuilder.SSL.LocalCertificateSelectionCallback   = this.ContextLocalCertificateSelect;
        }