AcmeLib 1.0.1

dotnet add package AcmeLib --version 1.0.1
                    
NuGet\Install-Package AcmeLib -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AcmeLib" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AcmeLib" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="AcmeLib" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AcmeLib --version 1.0.1
                    
#r "nuget: AcmeLib, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AcmeLib@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AcmeLib&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=AcmeLib&version=1.0.1
                    
Install as a Cake Tool

AcmeLib简介

AcmeLib 现代化的Acme协议 C# 客户端库,支持全部的Acme及相关补充协议,支持AOT编译。

AcmeLib is a modern Acme protocol C# client library that supports all Acme and related supplementary agreements, and is compatible with AOT compilation.

支持的ACME协议内容

支持的挑战类型

  1. HTTP-01(rfc8555);

  2. DNS-01(rfc8555);

  3. Tls-Alpn-01(rfc8737);

  4. Dns-Persist-01(Dns-Persist-01);

支持的标识符类型

  1. DNS(rfc8555);

  2. IP(rfc8738);

支持的扩展

  1. Profiles Extension(Profiles Extension);

  2. ARI Extension(rfc9773);

使用方式

密钥管理

账户密钥和证书密钥均由 AcmeLib.Key.KeyManager 进行管理,可以新生成或从PEM字符串加载。

AcmeLib 支持的密钥类型在 AcmeLib.Key.KeyTypeName 中进行定义,如需其他密钥类型,可自行实现 AcmeLib.Key.IKey 接口。

Acme操作

所有的Acme操作均封装在了 AcmeLib.AcmeClient 类及相关扩展方法中,使用时需要初始化该类的实例,同时第一个调用的方法应当为 NewAccount 或者 SetAccount 来进行账户初始化的操作。

var acmeClient = new AcmeClient("<acme directory url>");
var accountKey = KeyManager.CreateNew(KeyTypeName.ES384);
await AcmeClient.NewAccount(accountKey, true);

后续根据 Acme 流程进行其他操作

自定义HTTP请求处理器

如果环境特殊,发送HTTP请求时需要特殊处理,可继承 AcmeLib.HttpClient.SimpleHttpClient(这个也是默认的HTTP请求处理器) 并重写 SendCoreAsync 方法进行自定义处理。在初始化 AcmeLib.AcmeClient 时作为第二个参数传入,即可接管所有HTTP请求发送。

如需更进一步接管,可直接实现 AcmeLib.HttpClient.IHttpClient 接口。

兼容性警告

  1. 因为 .net 8.0 框架与 .net 9.0及以上框架存在部分特性(Attribute)及泛型约束的差异,虽然尽可能保证暴露出的接口一致性,但部分实现方式仍然有不可避免地差异。所以尽可能在使用本库的项目中保持编译框架与运行框架版本一致。

  2. Profiles Extension 和 Dns-Persist-01 仍在草案阶段,随时可能会有大的变动,本库也可能会根据草案变动出现某些不兼容修改,请注意。

许可证

Copyright (C) 2026 lchfj.cn

AcmeLib总体遵循LGPLv3协议进行开源,但针对特定情况增加以下额外的限制以及豁免。

1、额外限制:

您应当在任何情况下开源所有对本库所做出的任何修改,包括但不限于GPL定义的情形以及个人使用、服务器部署等情况。

2、额外豁免:

在进行AOT编译时,如果仅仅是引用(直接引用或NUGET引用)未做任何修改的编译后的库文件,那么允许不开源非本库代码的内容。

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 168 6/28/2026