Example #1
0
        public static void InitializeDicomSecurity(bool forceInitialize)
        {
            if ((_dicomSecurityAgent == null) || (forceInitialize))
            {
                if (ServiceLocator.IsRegistered <IDicomSecurity>())
                {
                    _dicomSecurityAgent = ServiceLocator.Retrieve <IDicomSecurity>();
                }
            }

            if ((_dicomSecurityCiphersAgent == null) || (forceInitialize))
            {
                if (ServiceLocator.IsRegistered <IDicomSecurityCiphers>())
                {
                    _dicomSecurityCiphersAgent = ServiceLocator.Retrieve <IDicomSecurityCiphers>();
                }
            }

            if (_cipherSuiteList == null || (forceInitialize))
            {
                if (_dicomSecurityCiphersAgent != null)
                {
                    _cipherSuiteList = _dicomSecurityCiphersAgent.CipherSuiteList;
                }
            }

            if ((_openSslOptions == null) || (forceInitialize))
            {
                if (_dicomSecurityAgent != null)
                {
                    _openSslOptions =
                        new DicomOpenSslContextCreationSettings(
                            _dicomSecurityAgent.SslMethodType,
                            _dicomSecurityAgent.CertificationAuthoritiesFileName,
                            _dicomSecurityAgent.VerificationFlags,
                            _dicomSecurityAgent.MaximumVerificationDepth,
                            _dicomSecurityAgent.Options);
                }
            }
        }
Example #2
0
        public void RunView(SecurityOptionsView view, AdvancedSettings settings)
        {
            DicomSecurityOptions clonedOptions;

            _view     = view;
            _settings = settings;

            if (ServiceLocator.IsRegistered <IDicomSecurity>())
            {
                _dicomSecurityAgent = ServiceLocator.Retrieve <IDicomSecurity>();
            }

            try
            {
                _options = OnReadSecurityOptions();
                if (_options == null)
                {
                    _options = new DicomSecurityOptions();
                    OnWriteSecurityOptions(_options);
                }
            }
            catch (Exception e)
            {
                Logger.Global.Exception("DICOM Security", e);
                if (_options == null)
                {
                    _options = new DicomSecurityOptions();
                }
            }

            clonedOptions = _options.Clone <DicomSecurityOptions>();
            _view.Initialize(clonedOptions);
            _view.Enabled = true;

            _view.SettingsChanged += new EventHandler(View_SettingsChanged);
        }