Skip to content

Provides client and server implementations of ACME (RFC 8555) in C-Sharp. It enables you to build solutions that provide complete and robust certificate lifecycle management.

License

Notifications You must be signed in to change notification settings

PeculiarVentures/acme-cs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACME-CS

ACME .NET

About

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.

Installation

Install-Package ACME-CS

Usage

Server

To create a server, see an example server

Client

Create client:

var client = AcmeClient.CreateAsync(Uri rootUrl, AsymmetricAlgorithm key);

Directory

Get directory:

var directory = client.DirectoryGetAsync()

or

var directory = client.Directory;

Account

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();

Order

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()),
    }
);

Authorization

Create authorization:

var authorization = await client.AuthorizationCreateAsync(order.Authorizations[0]);

Deactivate authorization:

var authorization = await client.AuthorizationDeactivateAsync(order.Authorizations[0]);

Challenge

Get challenge:

var challenge = await client.ChallengeGetAsync(authorization.Challenges[0]);

Validate challenge:

var challenge = await client.ChallengeValidateAsync(authorization.Challenges[0]);

Certificate

Get certificate:

var cert = await client.OrderCertificateGetAsync(order.Certificate);

Revoke certificate:

await client.CertificateRevokeAsync(new RevokeCertificate {
  Certificate = Base64Url.Encode(certificateBytes),
  Reason = Reason,
});

About

Provides client and server implementations of ACME (RFC 8555) in C-Sharp. It enables you to build solutions that provide complete and robust certificate lifecycle management.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages