Exemplo n.º 1
0
 public Base(string clientPEM, DicomTlsCipherSuiteType tlsCipherSuiteType,
             DicomTlsCertificateType tlsCertificateType, string privateKeyPassword)
     : base(null, DicomNetSecurityeMode.Tls)
 {
     PrivateKeyPassword = privateKeyPassword;
     SetTlsCipherSuiteByIndex(0, tlsCipherSuiteType);
     SetTlsClientCertificate(clientPEM, tlsCertificateType, null);
     _isSecureTLS = true;
 }
Exemplo n.º 2
0
        public Base(string clientPEM, DicomTlsCipherSuiteType tlsCipherSuiteType, DicomTlsCertificateType tlsCertificateType, string privateKeyPassword)
            : base(null, DicomNetSecurityMode.Tls)
#endif // #if !LEADTOOLS_V20_OR_LATER
        {
            PrivateKeyPassword = privateKeyPassword;
            SetTlsCipherSuiteByIndex(0, tlsCipherSuiteType);
            SetTlsClientCertificate(clientPEM, tlsCertificateType, null);
            _isSecureTLS = true;
        }
Exemplo n.º 3
0
        private void Find_AfterSecureLinkReady(object sender, AfterSecureLinkReadyEventArgs e)
        {
            DicomConnection connection = sender as DicomConnection;

            if (e.Error == DicomExceptionCode.Success)
            {
                DicomTlsCipherSuiteType cipher = connection.GetTlsCipherSuite();
                GatewaySession.Log(LogType.Information, String.Format(SECURE_LINK_READY_CIPHERSUITE, cipher.GetCipherFriendlyName()));
            }
            else
            {
                GatewaySession.Log(LogType.Information, String.Format(SECURE_LINK_FAILED, e.Error));
            }
        }
Exemplo n.º 4
0
        private void store_AfterSecureLinkReady(object sender, AfterSecureLinkReadyEventArgs e)
        {
            StoreScu connection = sender as StoreScu;

            if (e.Error == DicomExceptionCode.Success)
            {
                DicomTlsCipherSuiteType cipher = connection.GetTlsCipherSuite();

                LogEvent(LogType.Information, MessageDirection.Input,
                         String.Format(SECURE_LINK_READY_CIPHERSUITE, cipher.GetCipherFriendlyName()),
                         DicomCommandType.Undefined, null, connection, null);
            }
            else
            {
                LogEvent(LogType.Information, MessageDirection.Input,
                         String.Format(SECURE_LINK_FAILED, e.Error),
                         DicomCommandType.Undefined, null, connection, null);
            }
        }
Exemplo n.º 5
0
 public CEcho(string clientPEM, DicomTlsCipherSuiteType tlsCipherSuiteType, DicomTlsCertificateType tlsCertificateType, string privateKeyPassword)
     : base(clientPEM, tlsCipherSuiteType, tlsCertificateType, privateKeyPassword)
 {
 }
Exemplo n.º 6
0
        private void cstore_Status(object sender, StatusEventArgs e)
        {
            string message = "";
            bool   done    = false;

            if (e.Type == StatusType.Error)
            {
                message = "DICOM error. The process will be terminated! -- Error code is: " + e.Error.ToString();
            }
            else
            {
                switch (e.Type)
                {
                case StatusType.ConnectFailed:
                    message = "Connect operation failed.";
                    done    = true;
                    break;

                case StatusType.ConnectSucceeded:
                    message  = "Connected successfully.\n";
                    message += "\tPeer Address:\t" + e.PeerIP.ToString() + "\n";
                    message += "\tPeer Port:\t\t" + e.PeerPort.ToString();
                    break;

                case StatusType.SendAssociateRequest:
                    message = "Sending association request...";
                    break;

                case StatusType.ReceiveAssociateAccept:
                    message  = "Received Associate Accept.\n";
                    message += "\tCalling AE:\t" + e.CallingAE + "\n";
                    message += "\tCalled AE:\t" + e.CalledAE;
                    break;

                case StatusType.ReceiveAssociateReject:
                    message  = "Received Associate Reject!";
                    message += "\tResult: " + e.Result.ToString();
                    message += "\tReason: " + e.Reason.ToString();
                    message += "\tSource: " + e.Source.ToString();
                    break;

                case StatusType.AbstractSyntaxNotSupported:
                    message = "Abstract Syntax NOT supported!";
                    break;

                case StatusType.SendCStoreRequest:
                    message = "Sending C-STORE Request...";
                    break;

                case StatusType.ReceiveCStoreResponse:
                    if (e.Error == DicomExceptionCode.Success)
                    {
                        message = "**** Storage completed successfully ****";
                    }
                    else
                    {
                        message = "**** Storage failed with status: " + e.Status.ToString();
                    }
                    break;

                case StatusType.ConnectionClosed:
                    message = "Network Connection closed!";
                    done    = true;
                    break;

                case StatusType.ProcessTerminated:
                    message = "Process has been terminated!";
                    done    = true;
                    break;

                case StatusType.SendReleaseRequest:
                    message = "Sending release request...";
                    break;

                case StatusType.ReceiveReleaseResponse:
                    message = "Receiving release response";
                    done    = true;
                    break;

                case StatusType.Timeout:
                    message = "Communication timeout. Process will be terminated.";
                    done    = true;
                    break;

                case StatusType.SecureLinkReady:
                {
                    DicomNet net = sender as DicomNet;
                    if (net != null)
                    {
                        DicomTlsCipherSuiteType cipher = net.GetTlsCipherSuite();
                        if (e.Error == DicomExceptionCode.Success)
                        {
                            message = string.Format("\n\tSecure Link Ready\n\tCipher Suite: {0}", cipher.GetCipherFriendlyName());
                        }
                        else
                        {
                            message =
                                "\n\t" + "Secure Link Failed" +
                                "\n\t" + "Error:\t" + e.Error.ToString();
                        }
                    }
                }
                break;
                }
            }
            LogText(message);
            if (done)
            {
                EnableFileMenu(true);

                if (cstore.IsConnected())
                {
                    cstore.Close();
                }
            }
        }
Exemplo n.º 7
0
 public Base(string clientPEM, DicomTlsCipherSuiteType tlsCipherSuiteType, DicomTlsCertificateType tlsCertificateType, string privateKeyPassword)
     : base(null, DicomNetSecurityeMode.Tls)