ACMESharp.AcmeClient.RefreshAuthorizeChallenge C# (CSharp) Метод

RefreshAuthorizeChallenge() публичный Метод

public RefreshAuthorizeChallenge ( AuthorizationState authzState, string type, bool useRootUrl = false ) : void
authzState AuthorizationState
type string
useRootUrl bool
Результат void
        public void RefreshAuthorizeChallenge(AuthorizationState authzState, string type, bool useRootUrl = false)
        {
            AssertInit();
            AssertRegistration();

            var c = authzState.Challenges.FirstOrDefault(x => x.Type == type);
            if (c == null)
                throw new ArgumentOutOfRangeException(nameof(type), "no challenge found matching requested type")
                        .With(nameof(type), type);

            var requUri = new Uri(c.Uri);
            if (useRootUrl)
                requUri = new Uri(RootUrl, requUri.PathAndQuery);

            var resp = RequestHttpGet(requUri);
            var cp = JsonConvert.DeserializeObject<ChallengePart>(resp.ContentAsString);

            c.Type = cp.Type;
            c.Uri = cp.Uri;
            c.Token = cp.Token;
            c.Status = cp.Status;
        }