SectigoCertificateManager 0.1.0

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

SectigoCertificateManager

This library provides a simple client for the Sectigo Certificate Manager API.

The library defaults to API version 25.6 as defined in ApiConfigBuilder. Support for version 25.5 remains available via ApiVersion.V25_5. To target version 25.6 explicitly, use ApiVersion.V25_6.

Installation

  • NuGet: dotnet add package SectigoCertificateManager
  • PowerShell module (built from this repo): Import-Module SectigoCertificateManager
  • Targets: net10.0, net9.0, net8.0, netstandard2.0, net472
  • License: MIT · Source: https://github.com/EvotecIT/SectigoCertificateManager

The core library now supports two connection modes:

  • Legacy SCM API – username/password + customer URI (ApiConfig).
  • Admin Operations API – OAuth2 client credentials (AdminApiConfig) with routing handled by CertificateService.

Choosing legacy vs Admin API

  • Use the legacy SCM API when you already rely on username/password credentials and require features that are not yet exposed via the Admin Operations API (for example, some inventory and order/organization flows).
  • Use the Admin Operations API when you want modern OAuth2 client credentials, better alignment with the web portal’s “Admin” experience, and access to newer SSL endpoints such as /api/ssl/v2.

Documentation

HTML copies of the official API reference are included in the repository:

Fluent API (legacy SCM)

Create an ApiConfig using the fluent builder:

var config = new ApiConfigBuilder()
    .WithBaseUrl("https://cert-manager.com/api")
    .WithCredentials("user", "pass")
    .WithCustomerUri("cst1")
    .WithApiVersion(ApiVersion.V25_6)
    .WithConcurrencyLimit(5)
    // configure handler or attach a client certificate if needed
    .WithHttpClientHandler(h => h.AllowAutoRedirect = false)
    .WithClientCertificate(myCert)
    .Build();

using var client = new SectigoClient(config);
var certificates = new CertificatesClient(client);
var cert = await certificates.GetAsync(12345);

Fluent API (Admin Operations API + CertificateService)

Use OAuth2 client credentials generated in the API Keys area of the Sectigo Certificate Manager portal, and route calls through CertificateService:

using SectigoCertificateManager;
using SectigoCertificateManager.AdminApi;

var adminConfig = new AdminApiConfig(
    "https://admin.enterprise.sectigo.com",
    "https://auth.sso.sectigo.com/auth/realms/apiclients/protocol/openid-connect/token",
    "<client id>",
    "<client secret>");

using var service = new CertificateService(adminConfig);
var list = await service.ListAsync(size: 10, position: 0);

foreach (var cert in list)
{
    Console.WriteLine($"{cert.Id}: {cert.CommonName}");
}

The same CertificateService can be constructed from ApiConfig to talk to the legacy API; callers do not need to care which API is active.

PowerShell Module

Import the module once, then connect using either legacy or Admin mode. Subsequent cmdlets reuse the active connection.

Import-Module ./SectigoCertificateManager.PowerShell.dll

Legacy connection (username/password)

Connect-Sectigo -BaseUrl "https://cert-manager.com/api" `
                -Username "user" `
                -Password "pass" `
                -CustomerUri "tenant1" `
                -ApiVersion V25_6

# Retrieve a single certificate
Get-SectigoCertificate -CertificateId 12345

# List certificates
Get-SectigoCertificate -Size 50 -Position 0

# Download a certificate
Export-SectigoCertificate -CertificateId 12345 -Path './cert.pem'

# Check status / revocation
Get-SectigoCertificateStatus -CertificateId 12345
Get-SectigoCertificateRevocation -CertificateId 12345

# Legacy-only operations (inventory, orders, organizations):
Get-SectigoInventory
Get-SectigoOrders
Get-SectigoOrganizations

Admin Operations API connection (OAuth2 client credentials)

Connect-Sectigo -ClientId "<client id>" `
                -ClientSecret "<client secret>" `
                -Instance "enterprise" `
                -AdminBaseUrl "https://admin.enterprise.sectigo.com"

# The same cmdlets route through the Admin API:
Get-SectigoCertificate -CertificateId 17331734
Export-SectigoCertificate -CertificateId 17331734 -Path './admin-cert.pem'
Export-SectigoCertificate -CertificateId 17331734 -Format Pfx -Path './admin-cert.pfx' -PfxPassword (Read-Host -AsSecureString "Pfx password")
Get-SectigoCertificateStatus -CertificateId 17331734
Get-SectigoCertificateRevocation -CertificateId 17331734

# List latest certificates (Admin summary vs. detailed)
Get-SectigoCertificate -Size 30
Get-SectigoCertificate -Size 30 -Detailed

# Filter by status / requester / expiration (Admin only)
Get-SectigoCertificate -Size 50 -Status Issued -Requester 'user@example.com'
Get-SectigoCertificate -Size 50 -ExpiresBefore (Get-Date).AddDays(30)
Get-SectigoCertificate -Status Issued -ExpiresWithinDays 30

# Renew (Admin or legacy) and revoke with typed enums
# - Admin: use -CertificateId with an Admin connection
# - Legacy: use -OrderNumber with a legacy connection
Invoke-SectigoCertificateRenewal -CertificateId 17331734 -Csr (Get-Content .\new.csr -Raw) -DcvMode Email -DcvEmail 'admin@example.com'
# Legacy path:
# Invoke-SectigoCertificateRenewal -OrderNumber 10 -Csr 'CSR' -DcvMode Email -DcvEmail 'admin@example.com'

# Notes on renewals
# - The Admin Operations API requires a CSR for renewals (Sectigo does not auto-generate keys for you).
# - If you need a CSR at runtime, use the CsrGenerator helper (see SectigoCertificateManager.Examples) before calling Invoke-SectigoCertificateRenewal.
# - After renewal, download the new certificate for delivery:
#     Export-SectigoCertificate -CertificateId $newId -Path './renewed.cer'
#     Export-SectigoCertificate -CertificateId $newId -Format Pfx -PfxPassword (Read-Host -AsSecureString 'Password') -Path './renewed.pfx'

# Generate a CSR (PowerShell)
$csr = New-SectigoCsr -CommonName 'example.com' -DnsName 'example.com','www.example.com' -Organization 'Example' -Country 'US'

# Use generated CSR for Admin renew
Invoke-SectigoCertificateRenewal -CertificateId 11552108 -Csr $csr.Csr -DcvMode Email -DcvEmail 'admin@example.com'

# Use generated CSR for a legacy order
$order = New-SectigoOrder -CertificateType 501 -Term 365 -Csr $csr.Csr -SubjectAlternativeNames 'example.com','www.example.com'

Remove-SectigoCertificate -CertificateId 17331734 -ReasonCode KeyCompromise -Reason 'Key compromised'

# Inventory and most order/organization-related cmdlets currently remain
# legacy-only and will throw if used with an Admin connection.

Use -SubjectAlternativeNames on New-SectigoOrder to specify multiple SAN values when placing an order (legacy mode only for now).

CLI

The CLI shares the same routing logic as PowerShell: if Admin OAuth2 environment variables are present it uses the Admin API; otherwise it uses the legacy configuration loaded by ApiConfigLoader.

Legacy usage

Configure your legacy API settings in the JSON file consumed by ApiConfigLoader (see ApiConfigLoaderTests for examples), then run:

dotnet run --project SectigoCertificateManager.CLI get-ca-chain 123 ./chain.pem

Admin Operations API usage

export SECTIGO_CLIENT_ID="<client id>"
export SECTIGO_CLIENT_SECRET="<client secret>"
export SECTIGO_ADMIN_BASE_URL="https://admin.enterprise.sectigo.com"
export SECTIGO_TOKEN_URL="https://auth.sso.sectigo.com/auth/realms/apiclients/protocol/openid-connect/token"

dotnet run --project SectigoCertificateManager.CLI get-ca-chain 17331734 ./chain.pem

# List certificates expiring in the next 30 days (Admin only, using CertificateStatus enum)
dotnet run --project SectigoCertificateManager.CLI list-expiring 30 Issued

The search-orders CLI command currently remains legacy-only and uses the classic SCM API endpoints.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
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
0.1.0 678 12/2/2025