Kenc.ACMELib
ActiveA comprehensive .NET library for interacting with ACME (Automated Certificate Management Environment) servers to automate SSL certificate issuance and renewal.

Kenc.ACMELib provides a simple and reliable way to automate SSL/TLS certificate issuance and renewal using the ACME protocol. It’s designed to be easy to integrate into any .NET application while providing full control over the certificate management process.
Code Examples
Basic usage
var acmeClient = new ACMEClient(ACMEEnvironment.StagingV2, rsaKey, new RestClientFactory());ACMEDirectory directory = await acmeClient.InitializeAsync();var account = await acmeClient.RegisterAsync(new[] { "mailto:" + userContact });Order result = await acmeClient.OrderAsync(new[] { "domain.test", "*.domain.test" });Complete Certificate Request
// Create client and initializevar acmeClient = new ACMEClient(ACMEEnvironment.StagingV2, rsaKey, new RestClientFactory());await acmeClient.InitializeAsync();
// Register accountvar account = await acmeClient.RegisterAsync(new[] { "mailto:admin@example.com" });
// Create order for certificatesvar order = await acmeClient.OrderAsync(new[] { "example.com", "www.example.com" });
// Get authorizations that need to be completedvar authorizations = await acmeClient.GetAuthorizationsAsync(account, order);
// Complete each authorization (HTTP challenge shown here)foreach (var auth in authorizations){ var challenge = auth.Challenges.First(c => c.Type == "http-01"); var keyAuth = acmeClient.GetKeyAuthorization(account, challenge.Token);
// Implement method to make this value available at: // http://example.com/.well-known/acme-challenge/{challenge.Token} SetupHttpChallenge(challenge.Token, keyAuth);
// Notify ACME server to validate the challenge await acmeClient.CompleteChallenge(account, challenge);}
// Generate CSR and complete the ordervar privateKey = GenerateRsaPrivateKey();var csr = GenerateCsr(privateKey, new[] { "example.com", "www.example.com" });await acmeClient.FinalizeOrderAsync(account, order, csr);
// Download the certificatevar certificate = await acmeClient.GetCertificateAsync(account, order);