예제 #1
0
        static async Task CheckDnsRecordAsync(FreeCertContext context)
        {
            var res = await context.CheckDnsTxtRecordAsync();

            Console.WriteLine("Dns Check Information:");
            Console.WriteLine(" Status:" + res);
        }
예제 #2
0
        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}.");
        }
예제 #3
0
        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}");
        }
예제 #4
0
        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.");
            }
        }
예제 #5
0
        static async Task AuthorizationAsync(FreeCertContext context)
        {
            await context.AuthorizationAsync();

            Console.WriteLine("AuthorizationComplete!");
        }
예제 #6
0
        static async Task ExportAsync(FreeCertContext context)
        {
            await context.ExportCertAsync("123456");

            Console.WriteLine("Export Success!");
        }
예제 #7
0
        static async Task FinishAsync(FreeCertContext context)
        {
            await context.OrderFinalizeAsync();

            Console.WriteLine("Finish Success!");
        }