Certes 2.0.0

A client implementation for the Automated Certificate Management Environment (ACME) protocol.

There is a newer version of this package available.
See the version list below for details.
Install-Package Certes -Version 2.0.0
dotnet add package Certes --version 2.0.0
<PackageReference Include="Certes" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Certes --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Certes, 2.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Certes as a Cake Addin
#addin nuget:?package=Certes&version=2.0.0

// Install Certes as a Cake Tool
#tool nuget:?package=Certes&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Certes Twitter URL

Certes is an ACME client runs on .NET 4.5+ and .NET Standard 1.3+, supports ACME v2 and wildcard certificates. It is aimed to provide an easy to use API for managing certificates during deployment processes.

Usage

Install Certes nuget package into your project:

Install-Package Certes

or using .NET CLI:

dotnet add package Certes

Creating new ACME account:

var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2);
var account = acme.NewAccount("admin@example.com", true);

Place a wildcard certificate order (DNS validation is required for wildcard certificates)

var order = await acme.NewOrder(new[] { "*.your.domain.name" });

Generate the value for DNS TXT record

var authz = (await order.Authorizations()).First();
var dnsChallenge = await authz.Dns();
var dnsTxt = acme.AccountKey.DnsTxt(dnsChallenge.Token);

Add a DNS TXT record to _acme-challenge.your.domain.name with dnsTxt value.

For non-wildcard certificate, HTTP challenge is also available

var order = await acme.NewOrder(new[] { "your.domain.name" });

Get the token and key authorization string

var authz = (await order.Authorizations()).First();
var httpChallenge = await authz.Http();
var keyAuthz = httpChallenge.KeyAuthz;

Save the key authorization string in a text file, and upload it to http://your.domain.name/.well-known/acme-challenge/<token>

Ask the ACME server to validate our domain ownership

await challenge.Validate();

Download the certificate once validation is done

var privateKey = KeyFactory.NewKey(KeyAlgorithm.ES256);
var cert = await order.Generate(new CsrInfo
{
    CountryName = "CA",
    State = "Ontario",
    Locality = "Toronto",
    Organization = "Certes",
    OrganizationUnit = "Dev",
    CommonName = "your.domain.name",
}, privateKey);

Export PFX

var pfxBuilder = cert.ToPfx(privateKey);
var pfx = pfxBuilder.Build("my-cert", "abcd1234");

Check the APIs for more details.

For ACME v1, please see the doc here.

CLI

The CLI is available as a dotnet global tool. .NET Core Runtime 2.1+ (currently in preview) is required to use dotnet tools.

To install Certes CLI (you may need to restart the console session if this is the first dotnet tool installed)

dotnet install tool --global dotnet-certes --version 1.0.1-master-812

Use the --help option to get started

certes --help

or check this AppVeyor script for renewing certificate on Azure webapps.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Also check the changelog to see what's we are working on.

CI Status

NuGet NuGet NuGet NuGet

AppVeyor AppVeyor codecov BCH compliance

Certes Twitter URL

Certes is an ACME client runs on .NET 4.5+ and .NET Standard 1.3+, supports ACME v2 and wildcard certificates. It is aimed to provide an easy to use API for managing certificates during deployment processes.

Usage

Install Certes nuget package into your project:

Install-Package Certes

or using .NET CLI:

dotnet add package Certes

Creating new ACME account:

var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2);
var account = acme.NewAccount("admin@example.com", true);

Place a wildcard certificate order (DNS validation is required for wildcard certificates)

var order = await acme.NewOrder(new[] { "*.your.domain.name" });

Generate the value for DNS TXT record

var authz = (await order.Authorizations()).First();
var dnsChallenge = await authz.Dns();
var dnsTxt = acme.AccountKey.DnsTxt(dnsChallenge.Token);

Add a DNS TXT record to _acme-challenge.your.domain.name with dnsTxt value.

For non-wildcard certificate, HTTP challenge is also available

var order = await acme.NewOrder(new[] { "your.domain.name" });

Get the token and key authorization string

var authz = (await order.Authorizations()).First();
var httpChallenge = await authz.Http();
var keyAuthz = httpChallenge.KeyAuthz;

Save the key authorization string in a text file, and upload it to http://your.domain.name/.well-known/acme-challenge/<token>

Ask the ACME server to validate our domain ownership

await challenge.Validate();

Download the certificate once validation is done

var privateKey = KeyFactory.NewKey(KeyAlgorithm.ES256);
var cert = await order.Generate(new CsrInfo
{
    CountryName = "CA",
    State = "Ontario",
    Locality = "Toronto",
    Organization = "Certes",
    OrganizationUnit = "Dev",
    CommonName = "your.domain.name",
}, privateKey);

Export PFX

var pfxBuilder = cert.ToPfx(privateKey);
var pfx = pfxBuilder.Build("my-cert", "abcd1234");

Check the APIs for more details.

For ACME v1, please see the doc here.

CLI

The CLI is available as a dotnet global tool. .NET Core Runtime 2.1+ (currently in preview) is required to use dotnet tools.

To install Certes CLI (you may need to restart the console session if this is the first dotnet tool installed)

dotnet install tool --global dotnet-certes --version 1.0.1-master-812

Use the --help option to get started

certes --help

or check this AppVeyor script for renewing certificate on Azure webapps.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Also check the changelog to see what's we are working on.

CI Status

NuGet NuGet NuGet NuGet

AppVeyor AppVeyor codecov BCH compliance

NuGet packages (14)

Showing the top 5 NuGet packages that depend on Certes:

Package Downloads
FluffySpoon.AspNet.LetsEncrypt
Package Description
LettuceEncrypt
Provides API for configuring ASP.NET Core to automatically generate HTTPS certificates. This configures your server to use the ACME protocol to connect with a certificate authority (CA), such as Let's Encrypt (https://letsencrypt.org), to verify ownership of your domain name and generate a HTTPS certificate. This happens automatically when the server starts up, and will renew the certificate automatically when the expiration date is near. This only works with Kestrel, which is the default server configuration for ASP.NET Core projects. Other servers, such as IIS and nginx, are not supported.
letsencrypt.azure.core
Library for easy installation and renewals of Let's Encrypt SSL certificates on Azure Web Apps. PLEASE READ and understand the known limitations listed here: https://github.com/sjkp/letsencrypt-siteextension/blob/master/README.md#known-issues
FluffySpoon.AspNet.EncryptWeMust
Package Description
TecWare.DES.Module.ACME
ACME wrapper for the data exchange server.

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on Certes:

Repository Stars
natemcmaster/LettuceEncrypt
Free, automatic HTTPS certificate generation for ASP.NET Core web apps
sjkp/letsencrypt-siteextension
Azure Web App Site Extension for easy installation and configuration of Let's Encrypt issued SSL certifcates for custom domain names.
Maarten88/rrod
Exploring a new web architecture with React, Redux, Orleans and Dotnet Core
ffMathy/FluffySpoon.AspNet.EncryptWeMust

Version History

Version Downloads Last updated
3.0.0 2,659 7/18/2021
2.3.4 98,039 3/27/2020
2.3.3 209,140 12/17/2018
2.3.2 18,169 10/20/2018
2.3.1 983 10/16/2018
2.3.0 16,560 6/15/2018
2.2.2 1,439 5/31/2018
2.2.1 1,364 5/15/2018
2.2.0 2,239 5/5/2018
2.1.0 1,212 4/28/2018
2.0.1 1,971 3/17/2018
2.0.0 1,307 3/13/2018
1.1.4 1,994 3/4/2018
1.1.3 7,276 11/23/2017
1.1.2 3,018 9/28/2017
1.1.0 2,761 8/17/2017
1.0.7 7,959 7/20/2017
1.0.6.202 2,294 4/4/2017
1.0.5.191 1,131 3/29/2017
1.0.4.178 1,063 3/29/2017
1.0.3.139 1,116 12/22/2016
1.0.2.108 1,291 7/13/2016
1.0.1.64 1,146 7/6/2016
1.0.0.55 1,236 7/6/2016
Show less