Exemplo n.º 1
0
        public async Task <AccountDetails> CreateAccountAsync(
            IEnumerable <string> contacts,
            bool termsOfServiceAgreed)
        {
            ACMESharp.Protocol.AccountDetails
                account = await _client.CreateAccountAsync(contacts, termsOfServiceAgreed);

            _logger.LogInformation($"Account created {account.Payload.Id}.");
            return(new AccountDetails(account, _client.Signer));
        }
Exemplo n.º 2
0
        public void SetAccount(AccountDetails accountDetails)
        {
            var acmeSharpAcctDetails = new ACMESharp.Protocol.AccountDetails
            {
                Kid     = accountDetails.Kid,
                TosLink = accountDetails.TosLink,
                Payload = new ACMESharp.Protocol.Resources.Account
                {
                    Id      = accountDetails.Id,
                    Contact = accountDetails.Contact,
                    Status  = accountDetails.Status.ToString().ToLower(),
                    TermsOfServiceAgreed = accountDetails.TermsOfServiceAgreed,
                    Orders    = accountDetails.OrdersUrl,
                    InitialIp = accountDetails.InitialIp,
                    CreatedAt = accountDetails.CreatedAt,
                    Agreement = accountDetails.Agreement
                }
            };

            _client.Account = acmeSharpAcctDetails;
            _client.Signer.Import(accountDetails.KeyExport);
        }