示例#1
0
        public PemFiles(
            ILogService log, ISettingsService settings,
            PemService pemService, PemFilesOptions options)
        {
            _log        = log;
            _pemService = pemService;

            _password = !string.IsNullOrWhiteSpace(options.PemPassword?.Value) ?
                        options.PemPassword.Value :
                        settings.Store.PemFiles?.DefaultPassword;

            var path = options.Path;

            if (string.IsNullOrWhiteSpace(path))
            {
                path = DefaultPath(settings);
            }
            if (!string.IsNullOrWhiteSpace(path) && path.ValidPath(log))
            {
                _log.Debug("Using .pem files path: {path}", path);
                _path = path;
            }
            else
            {
                throw new Exception($"Specified .pem files path {path} is not valid.");
            }
        }
示例#2
0
文件: PemFiles.cs 项目: jtv5/win-acme
 public PemFiles(ILogService log, PemService pemService, PemFilesOptions options)
 {
     _log        = log;
     _pemService = pemService;
     if (!string.IsNullOrWhiteSpace(options.Path))
     {
         _path = options.Path;
     }
     if (_path.ValidPath(log))
     {
         _log.Debug("Using .pem certificate path: {_path}", _path);
     }
     else
     {
         throw new Exception("Error initializing PemFiles plugin, specified path is not valid.");
     }
 }
示例#3
0
 public PemFiles(
     ILogService log, ISettingsService settings,
     PemService pemService, PemFilesOptions options)
 {
     _log        = log;
     _pemService = pemService;
     _path       = !string.IsNullOrWhiteSpace(options.Path) ?
                   options.Path :
                   settings.Store.DefaultPemFilesPath;
     if (_path.ValidPath(log))
     {
         _log.Debug("Using .pem certificate path: {_path}", _path);
     }
     else
     {
         throw new Exception($"Specified PemFiles path {_path} is not valid.");
     }
 }