public CertificateProbe(ProbeConfig config, string logFilePath)
        {
            doFind_  = !String.IsNullOrWhiteSpace(config.FindValue);
            doProbe_ = !String.IsNullOrWhiteSpace(config.ServerUri);

            if (doFind_)
            {
                localStore_     = config.StoreName;
                localFindType_  = Enum.Parse <X509FindType>(config.FindType);
                localFindValue_ = config.FindValue;
            }

            logger_ = new Logger(logFilePath);
            if (doProbe_)
            {
                serverCertExplorer_ = new ServerCertExplorer(config.ServerUri, config.Ports, logger_);
            }

            probeDriver_ = ConfigureProbeDriver(TimeSpan.FromSeconds(config.TimerInterval));

            CertExplorer.Logger = logger_;
            CertExplorer.Config = new CertExplorerConfig {
                DoVerboseLogging = false,
                FindType         = config.FindType,
                FindValue        = localFindValue_,
                StoreName        = localStore_,
                LogLevel         = config.LogLevel
            };
        }
        public TimedProbe ConfigureProbeDriver(TimeSpan observationInterval)
        {
            var probeDriver = new TimedProbe(observationInterval);

            if (doFind_)
            {
                probeDriver.RegisterObserver("local cert observer", new TimerCallback(CertificateInventoryCallback), this);
            }

            if (doProbe_)
            {
                probeDriver.RegisterObserver("remote cert observer", new TimerCallback(ServerCertExplorer.Probe), serverCertExplorer_);
            }

            return(probeDriver);
        }
        public CertificateProbe(
            string localCertStoreName,
            X509FindType localCertFindType,
            string localCertFindValue,
            string serverUri,
            int[] ports,
            TimeSpan observationInterval,
            string logFilePath)
        {
            if (String.IsNullOrWhiteSpace(localCertStoreName))
            {
                throw new ArgumentException(nameof(localCertStoreName));
            }
            if (String.IsNullOrWhiteSpace(localCertFindValue))
            {
                throw new ArgumentException(nameof(localCertFindValue));
            }
            if (String.IsNullOrWhiteSpace(serverUri))
            {
                throw new ArgumentException(nameof(serverUri));
            }

            localStore_         = localCertStoreName;
            localFindType_      = localCertFindType;
            localFindValue_     = localCertFindValue;
            logger_             = new Logger(logFilePath);
            serverCertExplorer_ = new ServerCertExplorer(serverUri, ports, logger_);

            probeDriver_ = ConfigureProbeDriver(observationInterval);

            doFind_  = true;
            doProbe_ = true;

            CertExplorer.Logger = logger_;
            CertExplorer.Config = new CertExplorerConfig {
                DoVerboseLogging = false
            };
        }