public async Task <StatusMessage> RevokeCertificate(string pfxPath) { var fi = new FileInfo(pfxPath); string certAlias = fi.Name.Replace("-all.pfx", ""); return(await Task <StatusMessage> .Run(() => { try { return new StatusMessage() { IsOK = true, Result = ACMESharpUtils.RevokeCertificate(certAlias) }; } catch (Exception ex) { return new StatusMessage() { IsOK = false, FailedItemSummary = new List <string>() { $"Certificate revocation error: {ex.Message}" }, Message = ex.Message }; } })); }