public IdentifierItem GetDomainIdentifierItemFromIdentifierInfo(ACMESharp.Vault.Model.IdentifierInfo identifier) { if (identifier == null) { return(null); } var i = new IdentifierItem { Id = identifier.Id.ToString(), Alias = identifier.Alias, Name = identifier.Dns, Dns = identifier.Dns, Status = identifier.Authorization?.Status }; if (identifier.Authorization != null) { i.AuthorizationExpiry = identifier.Authorization.Expires; i.IsAuthorizationPending = identifier.Authorization.IsPending(); if (identifier.Authorization.Status == "invalid") { var failedChallenge = identifier.Authorization.Challenges?.FirstOrDefault(c => c.ChallengePart?.Error != null); if (failedChallenge != null) { i.ValidationError = String.Join("\r\n", failedChallenge.ChallengePart.Error); i.ValidationErrorType = failedChallenge.ChallengePart.Error["type"]; } } } return(i); }
public IdentifierItem GetDomainIdentifierItemFromIdentifierInfo(ACMESharp.Vault.Model.IdentifierInfo identifier) { var i = new IdentifierItem { Id = identifier.Id.ToString(), Alias = identifier.Alias, Name = identifier.Dns, Dns = identifier.Dns, Status = identifier.Authorization?.Status, }; if (identifier.Authorization != null) { i.AuthorizationExpiry = identifier.Authorization.Expires; i.IsAuthorizationPending = identifier.Authorization.IsPending(); } return(i); }