private async Task <IKey> LoadExistingAccountKey(
            IAcmeOptions options,
            CancellationToken cancellationToken)
        {
            _logger.LogInformation($"starting -> LoadExistingAccountKey var fileName = GetAccountKeyFilename(options);");
            var fileName = GetAccountKeyFilename(options);

            _logger.LogInformation($"done -> var fileName = GetAccountKeyFilename(options);");

            _logger.LogInformation($"starting -> if (!await _storageProvider.ExistsAsync(fileName, cancellationToken))");
            if (!await _storageProvider.ExistsAsync(fileName, cancellationToken))
            {
                return(null);
            }
            _logger.LogInformation($"done -> if (!await _storageProvider.ExistsAsync(fileName, cancellationToken))");

            _logger.LogInformation($"starting -> await _storageProvider.GetAsync(fileName, cancellationToken);");
            var content = await _storageProvider.GetAsync(fileName, cancellationToken);

            _logger.LogInformation($"done -> await _storageProvider.GetAsync(fileName, cancellationToken);");

            _logger.LogInformation($"starting -> awaitvar result = _keyFactory.FromPem(content);");
            var result = _keyFactory.FromPem(content);

            _logger.LogInformation($"done -> awaitvar result = _keyFactory.FromPem(content);");
            return(result);
        }
Esempio n. 2
0
        private async Task <IKey> LoadExistingAccountKey(
            IAcmeOptions options,
            CancellationToken cancellationToken)
        {
            var fileName = GetAccountKeyFilename(options);

            if (!await _storageProvider.ExistsAsync(fileName, cancellationToken))
            {
                return(null);
            }

            var content = await _storageProvider.GetAsync(fileName, cancellationToken);

            return(_keyFactory.FromPem(content));
        }