Example #1
0
        public async Task <AccountDetails> GetAccountDetailsAsync()
        {
            string json = await _fileSystem.ReadStringAsync("account.json");

            if (string.IsNullOrEmpty(json))
            {
                return(null);
            }

            AccountDetails accountDetails = JsonSerializer.Deserialize <AccountDetails>(json);

            return(accountDetails);
        }
        private async Task <FileSystemCertCollectionFormat> GetFileSystemCertCollectionFormat()
        {
            string json = await _fileSystem.ReadStringAsync("certs.json");

            if (string.IsNullOrEmpty(json))
            {
                return(new FileSystemCertCollectionFormat {
                    Certs = new Dictionary <string, FileSystemCertFormat>()
                });
            }

            return(JsonSerializer.Deserialize <FileSystemCertCollectionFormat>(json));
        }
        private async Task <FSChallengeFormat> GetFSChallengeFormat()
        {
            string json = await _fileSystem.ReadStringAsync("challenges.json");

            if (string.IsNullOrEmpty(json))
            {
                return(new FSChallengeFormat()
                {
                    Challenges = new Dictionary <string, ChallengeDetails>()
                });
            }

            return(JsonSerializer.Deserialize <FSChallengeFormat>(json));
        }