百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

certes

> 编程语言
开源

自动证书管理环境 (ACME) 协议的客户端实现

572 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

自动证书管理环境 (ACME) 协议的客户端实现

Certes

Certes is an ACME client runs on .NET 4.5+ and .NET Standard 2.0+, 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:

powershell
Install-Package Certes

or using .NET CLI:

dos
dotnet add package Certes

Let's Encrypt is the primary CA we supported. It's recommend testing against staging environment before using production environment, to avoid hitting the rate limits.

Account

Creating new ACME account:

csharp
var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2);
var account = await acme.NewAccount("[email protected]", true);

// Save the account key for later use
var pemKey = acme.AccountKey.ToPem();

Use an existing ACME account:

csharp
// Load the saved account key
var accountKey = KeyFactory.FromPem(pemKey);
var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2, accountKey);
var account = await acme.Account();

See API doc for additional operations.

Order

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

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

Generate the value for DNS TXT record

csharp
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

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

Authorization

Get the token and key authorization string

csharp
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/

Validate

Ask the ACME server to validate our domain ownership

csharp
await challenge.Validate();

Certificate

Download the certificate once validation is done

csharp
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 full chain certification

csharp
var certPem = cert.ToPem();

Export PFX

csharp
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+ 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)

dos
dotnet tool install --global dotnet-certes

See CLI usage, or simply use the --help option to get started

dos
certes --help

Also check this AppVeyor script for renewing certificates on Azure apps.

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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#amcecerteshttpsletsencrypt

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言