opencertserver.est.client 5.0.0-beta-93

This is a prerelease version of opencertserver.est.client.
dotnet add package opencertserver.est.client --version 5.0.0-beta-93
                    
NuGet\Install-Package opencertserver.est.client -Version 5.0.0-beta-93
                    
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="opencertserver.est.client" Version="5.0.0-beta-93" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="opencertserver.est.client" Version="5.0.0-beta-93" />
                    
Directory.Packages.props
<PackageReference Include="opencertserver.est.client" />
                    
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 opencertserver.est.client --version 5.0.0-beta-93
                    
#r "nuget: opencertserver.est.client, 5.0.0-beta-93"
                    
#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 opencertserver.est.client@5.0.0-beta-93
                    
#: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=opencertserver.est.client&version=5.0.0-beta-93&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=opencertserver.est.client&version=5.0.0-beta-93&prerelease
                    
Install as a Cake Tool

opencertserver.est.client

The EST (Enrollment over Secure Transport, RFC 7030) client. It enrolls and re-enrolls X.509 certificates through a running EST server over HTTPS, and reads the server's published CA bundle and CSR attributes. This is the outbound half of the EST flow; the server it talks to is opencertserver.est.server.

What runs here

  • EstClient — the client. The constructor requires an HTTPS Uri; a non-HTTPS host throws ArgumentException. It drives the RFC 7030 endpoints:
    • Enroll<TAlgorithm>(distinguishedName, key, usageFlags, ...) — builds a PKCS#10 request and POSTs it to simpleenroll (or {profile}/simpleenroll). Returns (string? error, X509Certificate2Collection? certs): a non-null error is the server's plain-text reason, certs is the signed chain on success.
    • ReEnroll<TAlgorithm>(key, certificate, ...) — POSTs to simplereenroll, signing with the existing certificate's key so a different renewal key can be attached; the SAN is carried over to the new request.
    • ServerCertificates() — GETs cacerts and returns the server's PKCS#7-signed CA bundle (RFC 7030 §3.1 bootstrap trust).
    • GetCsrAttributes(authenticationHeader) — GETs csrattrs (RFC 9908) and returns the CertificateSigningRequestTemplate, or an empty template on 204/404.
  • EstClientOptions — trust and transport knobs (see below). Defaults favour the operating-system trust store.
  • EstBootstrapTrust — the provisional trust material captured during bootstrap (source URI, certificates, SHA-256 fingerprints), accepted or rejected before any other exchange continues.

The client never forwards a client certificate in an HTTP header; mTLS identity is presented on the TLS connection. It disables automatic redirects and follows only same-origin redirects, re-validating the server identity on each hop.

Trust model

EstClientOptions.TrustAnchorMode selects how the server certificate is validated:

Mode Meaning
ImplicitOnly (default) Use the operating-system trust store.
ExplicitOnly Validate only against ExplicitTrustAnchors; the system store is ignored.
ExplicitThenImplicit Try the explicit anchors first, then fall back to the system store.

With ExplicitOnly and no anchors, the client can bootstrap: a cacerts/fullcmc response is captured into PendingBootstrapTrust instead of being trusted. The caller then accepts or rejects it before continuing:

using var client = new EstClient(
    new Uri("https://est.example.com"),
    new EstClientOptions
    {
        TrustAnchorMode = EstTrustAnchorMode.ExplicitOnly,
        AllowBootstrapCaCertsWithoutTrustedServer = true,
    });

var certs = await client.ServerCertificates();      // captures pending bootstrap trust
if (client.PendingBootstrapTrust != null)
{
    // Inspect the fingerprints, then:
    client.AcceptBootstrapTrust();                   // or client.RejectBootstrapTrust()
}

While bootstrap trust is pending, any other EST exchange throws — the operator must decide on the new anchor first.

Usage

using OpenCertServer.Est.Client;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

using var key = RSA.Create(3072);
using var estClient = new EstClient(
    new Uri("https://est.example.com"),
    new EstClientOptions { TrustAnchorMode = EstTrustAnchorMode.ImplicitOnly });

// Enroll a new certificate.
var (error, chain) = await estClient.Enroll(
    new X500DistinguishedName("CN=service.example.com"),
    key,
    X509KeyUsageFlags.DigitalSignature | X509KeyUsageFlags.KeyEncipherment,
    authenticationHeader: new("Bearer", "<token>"));

if (error is null && chain is { Count: > 0 })
{
    var leaf = chain[0];
}

// Re-enroll an existing certificate (renewal).
var (renewError, renewed) = await estClient.ReEnroll(key, existingCertificate);

// Pull the published CA bundle.
var ca = await estClient.ServerCertificates();

For mTLS enrollment, pass a client certificate that carries its private key via Enroll(..., certificate: clientCert).

Dependencies

  • opencertserver.ca.utils — X.509/PKI helpers, the PKCS#7 (Ca.Utils.Pkcs7) and CSR-template (Ca.Utils.X509.Templates) types the client reads from the server.

This project is a library, not an application. It is consumed by opencertserver.cli for the est-enroll, est-reenroll and est-server-certificates commands.

Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
5.0.0-beta-93 10 12/3/2026
5.0.0-beta-86 88 11/29/2026
5.0.0-beta-85 91 11/28/2026
5.0.0-beta-82 94 11/27/2026
5.0.0-beta-68 88 11/25/2026
5.0.0-beta-66 90 11/25/2026
4.3.0 94 11/30/2026
4.2.0 108 11/24/2026
4.1.0 117 11/9/2026
4.0.0 107 11/6/2026
3.9.3 104 11/2/2026
3.9.2 115 10/24/2026
3.9.1 121 10/17/2026
3.9.0 115 10/13/2026
3.8.1 113 10/11/2026
3.8.0 145 9/24/2026
3.7.1 118 9/22/2026
3.7.0 133 9/20/2026
3.6.0 128 9/16/2026
3.5.1 122 9/13/2026
Loading failed