static async Task CheckDnsRecordAsync(FreeCertContext context) { var res = await context.CheckDnsTxtRecordAsync(); Console.WriteLine("Dns Check Information:"); Console.WriteLine(" Status:" + res); }
static async Task GetOrderInfoAsync(FreeCertContext context) { var order = await context.GetOrderInfoAsync(); Console.WriteLine("Current OrderInformation:"); Console.WriteLine($" Status : {order.Status}"); Console.WriteLine($" Domains: {string.Join(",", order.Domains)}"); Console.WriteLine($" Expires: {order.Expires:yyyy-MM-dd HH:mm:ss}"); await File.WriteAllTextAsync(orderUriFile, context.OrderContext.Location.ToString()); Console.WriteLine($" Order Uri saved at {orderUriFile}."); }
static async Task AutoCreateDnsAsync(FreeCertContext context) { var authResult = await context.AutoCreateDnsRecord(new TencentCloudDynamicDns(new TencentCloudOptions() { SecretId = tcloudSecretId, SecretKey = tcloudSecretKey })); Console.WriteLine(); Console.WriteLine("Auto CreateDns Result:"); Console.WriteLine($" Success : {authResult.Success}"); Console.WriteLine($" Message : {authResult.ErrorMessage}"); }
static async Task GetDnsRecordAsync(FreeCertContext context) { var records = await context.GetDnsTxtRecordAsync(); Console.WriteLine("Dns Record Information:"); if (records.Any()) { foreach (var record in records) { Console.WriteLine(" " + record); } } else { Console.WriteLine("No record."); } }
static async Task AuthorizationAsync(FreeCertContext context) { await context.AuthorizationAsync(); Console.WriteLine("AuthorizationComplete!"); }
static async Task ExportAsync(FreeCertContext context) { await context.ExportCertAsync("123456"); Console.WriteLine("Export Success!"); }
static async Task FinishAsync(FreeCertContext context) { await context.OrderFinalizeAsync(); Console.WriteLine("Finish Success!"); }