Esempio n. 1
0
        public async Task <string> GetDnsChallenge(string hostname, CancellationToken token = default(CancellationToken))
        {
            _hosts.Add(hostname);

            var challenge = await _client.NewDnsAuthorizationAsync(hostname, token);

            var dnsChallenge = challenge.Challenges.First(x => x.Type == "dns-01");
            var keyToken     = _client.GetKeyAuthorization(dnsChallenge.Token);
            var computedDns  = Jws.Base64UrlEncoded(SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(keyToken)));

            _challenges.Add(dnsChallenge);

            return(computedDns);
        }
Esempio n. 2
0
        public void ComputeKeyAuthorization()
        {
            var client = new AcmeClient(TestData.GetPrivateKey());

            Assert.Equal("token.aWqHvejQhMmUunCZtp_2yV_bOOR0DEdpDRqn8VgjjYY", client.GetKeyAuthorization("token"));
        }
Esempio n. 3
0
        public void A()
        {
            var client = new AcmeClient(RSA.Create(RSAPrivateKey.Decode(TestData.PrivateRSA256KeyText)));

            Assert.Equal("token.aWqHvejQhMmUunCZtp_2yV_bOOR0DEdpDRqn8VgjjYY", client.GetKeyAuthorization("token"));
        }