Cats.CertificateTransparency 5.0.1

dotnet add package Cats.CertificateTransparency --version 5.0.1
                    
NuGet\Install-Package Cats.CertificateTransparency -Version 5.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="Cats.CertificateTransparency" Version="5.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cats.CertificateTransparency" Version="5.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Cats.CertificateTransparency" />
                    
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 Cats.CertificateTransparency --version 5.0.1
                    
#r "nuget: Cats.CertificateTransparency, 5.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 Cats.CertificateTransparency@5.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=Cats.CertificateTransparency&version=5.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Cats.CertificateTransparency&version=5.0.1
                    
Install as a Cake Tool

Certificate Transparency for .NET

C# .NET port of,

Cats.CertificateTransparency Logo

alternate text is missing from this package README image

    Install-Package Cats.CertificateTransparency

Blog Post

Google CT Log List

By default, this library uses the Certificate Transparency log list published by Google for Chrome:

https://www.gstatic.com/ct/log_list/v3/

This is not recommended for production use.

Google's CT log list endpoints are intended to support Chrome and are subject to Google's Acceptable Use Policy. Google explicitly states that third-party CT enforcement libraries relying on these endpoints may break.

Google can change the endpoint, format, schema, or availability of the log list at any time. Google is also actively fingerprinting and restricting third-party access.

As a result, applications using the default Google log list may stop working without any change to this library or the application. This has already occurred for Android clients using a mobile User-Agent, and further breakage is likely.

For production applications, you should ideally maintain and host your own CT log list rather than depending on Google's Chrome-specific infrastructure. This gives you control over the list, endpoint, schema and availability.

If you continue to use Google's log list, treat it as an external dependency that Google can change or break at any time.

The library is designed to be dependency-injection friendly; every service class has a matching interface. However, to get things running quickly, there is also a static Instance class which constructs lazy singletons for both ILogListService and CertificateTransparencyVerifier.

If you want to provide a custom list of included and excluded domains to these static instances, call Instance.InitDomains first. By default, validation is enabled for all TLS-secured domains.

Instance.InitDomains(new [] { "*.google.com", "microsoft.com" }, new [] { "nuget.org" });

Examples

.NET

var client = new HttpClient(new HttpClientHandler()
{
    ServerCertificateCustomValidationCallback = (request, certificate, chain, sslPolicyErrors) =>
    {
        var certificateChain = chain.ChainElements.OfType<X509ChainElement>().Select(i => i.Certificate).ToList();
        var certificateVerifier = Cats.CertificateTransparency.Instance.CertificateTransparencyVerifier;
        var ctValueTask = certificateVerifier.IsValidAsync(request.RequestUri.Host, certificateChain, CancellationToken.None);

        var ctResult = ctValueTask.IsCompleted
            ? ctValueTask.Result
            : ctValueTask.AsTask().Result;

        return ctResult.IsValid;
    }
});

Android

Android 16+ (API 36) should use the native Android Certificate Transparency implementation instead of this library.

See Android's native CT enforcement and the default Android CT policy.

For applications targeting Android versions prior to Android 16, the Android implementation can be used:

bool VerifyCtResult(string hostname, IList<DotNetX509Certificate> certificateChain, CtVerificationResult result)
{
    // Fail open if the CT log list is unreachable.
    if (result == CtResult.LogServersFailed)
    {
        return true;
    }

    // Add any additional checks or logging here.
    return result.IsValid;
}

var httpHandler = new Cats.CertificateTransparency.CatsAndroidClientHandler(VerifyCtResult);
var client = new HttpClient(httpHandler);

iOS

There is currently no platform specific implementation for iOS. Certificate transparency is already enabled since iOS 12.1.1, however, it can be disabled per domain via a property list setting NSRequiresCertificateTransparency.

If you are keen you could use the CertificateVerifier to build your own HttpClientHandler, similar to the included Android implementation.

Log Lists

A CT log list contains the Certificate Transparency logs that are trusted for verification.

For production applications, maintaining your own log list is recommended. Your application then controls:

  • Which CT logs are trusted.
  • Where the log list is hosted.
  • The availability of the log list.
  • Updates to the log list.
  • The format and schema used by your application.

Using Google's Chrome log list is convenient but creates a dependency on infrastructure that is outside the control of this project. Google may change or restrict access to the list without notice, and applications should expect the Chrome log list to break eventually.

If you maintain your own log list, configure the library to use it through the appropriate ILogListService implementation.

Contributions

Any contributions are welcome! Especially extra test cases!

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  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.
  • net10.0-android36.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Cats.CertificateTransparency:

Package Downloads
LemonMarkets

Community C# Library #2 for Lemon Markets

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.1 364 9/9/2026
5.0.0 4,963 6/2/2026
4.0.0 5,688 12/29/2025
3.0.1 10,459 10/9/2024
3.0.0 280 9/29/2024
2.1.1 3,350 2/18/2023
2.1.0 422 2/15/2023
2.0.0 1,548 6/16/2022
1.3.0 1,216 11/11/2021
1.2.0 626 10/18/2021
1.1.0 1,828 3/2/2021
1.0.0 603 1/16/2021
0.0.1-pre 1,009 12/2/2020

- Updated to net10.0
- Removed BouncyCastle dependency
- Added User-Agent for Chrome log list requests (Android-only temporary workaround)
- Added note in README on the issues with using the Chrome CT log list
- Added note in README to avoid use of this library on Android 16+ (API 36)