Provides client and server implementations of ACME (RFC 8555) with C-Sharp. It enables you to build solutions that provide complete and robust certificate lifecycle management.
Install-Package ACME-CS
To create a server, see an example server
Create client:
var client = AcmeClient.CreateAsync(Uri rootUrl, AsymmetricAlgorithm key);
Get directory:
var directory = client.DirectoryGetAsync()
or
var directory = client.Directory;
Create account:
var acc = client.AccountCreateAsync(new NewAccount
{
Contacts = new string[] { "mailto: [email protected]" },
TermsOfServiceAgreed = true,
});
Get account:
var acc = client.AccountCreateAsync(new NewAccount
{
OnlyReturnExisting = true,
}));
Deactivate account:
client.AccountDeactivateAsync();
Create order:
var order = client.OrderCreateAsync(new NewOrder
{
Identifiers = new List<Identifier> { },
});
Get order:
var orderGet = await client.OrderGetAsync(order.Location);
Finalize order:
var param = new CertificateRequestParams
{
CommonName = "CN=CommonName",
};
var csr = new Pkcs10CertificateRequest(param, RsaKey);
var orderFinalize = await client.OrderFinalizeAsync(
order.Finalize,
new FinalizeOrder
{
Csr = Base64Url.Encode(csr.Export()),
}
);
Create authorization:
var authorization = await client.AuthorizationCreateAsync(order.Authorizations[0]);
Deactivate authorization:
var authorization = await client.AuthorizationDeactivateAsync(order.Authorizations[0]);
Get challenge:
var challenge = await client.ChallengeGetAsync(authorization.Challenges[0]);
Validate challenge:
var challenge = await client.ChallengeValidateAsync(authorization.Challenges[0]);
Get certificate:
var cert = await client.OrderCertificateGetAsync(order.Certificate);
Revoke certificate:
await client.CertificateRevokeAsync(new RevokeCertificate {
Certificate = Base64Url.Encode(certificateBytes),
Reason = Reason,
});