Self-hosted, Windows or Linux REST API for CI/CD

sgcSign Server, a Remote Code Signing Server for CI/CD

Remote code signing over HTTPS for every build agent.

Sign from any CI runner
Keys never reach the build agent
Authenticode, NuGet, ClickOnce, VSIX
Approvals and hash-chained audit log
Azure Trusted Signingsigntool /dlibWindows KSPSign from the hash, no uploadFree Community Edition for personal use

Sign in a CI/CD pipeline → · See pricing →

sign-release.cmd
rem CI job: the API key comes from the runner's secret store
set SGCSIGN_SERVER=https://sign.example.com:8443
set SGCSIGN_APIKEY=%SIGNING_API_KEY%

rem Authenticode: only the hash leaves the runner
sgcsign sign -f authenticode -p release -o MyApp-signed.exe MyApp.exe
sgcsign verify -f authenticode MyApp-signed.exe

rem The private key stays on the server, its HSM or cloud KMS

What Remote Code Signing Means

Remote code signing for every build agent: one self-hosted code signing server signs over HTTPS, while the key stays on the server, in its HSM or in a cloud KMS.

The build agent sends a file or only its hash, the server signs it with a key the agent never sees, and the signed result comes back.

sgcSign Server is a self-hosted remote code-signing daemon that wraps the sgcSign engine behind a REST API, a Bootstrap web admin console, and a command line client for CI/CD pipelines. Instead of copying a signing certificate onto every build agent, you keep it in one place: on the server, on a hardware token or HSM the server fronts, or in a cloud service such as Azure Trusted Signing.

  • Every request is authenticated with an API key, rate limited and written to a hash-chained audit log.
  • Multi-tenant projects let several teams share one server without seeing each other's signing material.
  • Code formats (Authenticode, ClickOnce, NuGet, VSIX) and document formats (XAdES, PAdES, CAdES) share one REST API.
  • Operators manage users, API keys, providers, approvals and webhooks in the web admin console, without editing JSON.

Sign a 1 GB Installer From Its Hash

What Authenticode signs is a digest of the file, so the build agent computes it where the file already is and the server returns a signature of a few kilobytes.

A 1 GB installer signed twice through the sgcSign Server, once uploaded and once from its hash, with every byte on the wire counted. Read how hash signing works.

What You Get

A single host, Windows or Linux, accepts signing requests from build agents, developers, and CI pipelines, with full audit, approvals, and metrics built in.

REST API

TLS-secured /api/v1 endpoints for signing, verification, health, metrics, and approval workflows. Stable, machine-friendly contract for build agents and SDKs.

Web Admin Console

Bootstrap-based /admin UI for users, API keys, providers, projects, audit, approvals, webhooks, and metrics. Operators never need to edit JSON.

Windows-service Installer

Inno Setup wizard or zip-drop. The daemon registers itself as a Windows service, terminates TLS itself, and runs unattended on a hardened host.

Multi-tenant Projects

Each project isolates a subset of providers, API keys, audit visibility, and approval queues. Several teams share one server without seeing each other's signing material.

Two-step Approval Workflow

The same API key requests, an admin or project admin approves or rejects, and only then are the bytes signed. SHA-256 hash and file size are locked into the request.

SHA-256 Audit Log

Every action (sign, verify, login, approval, webhook fire) is appended to a hash-chained audit log. Tampering is detectable; SIEM scraping is straightforward.

Prometheus Metrics

Sign / verify / approval counters, signing-latency histograms, provider-availability gauges. Direct Prometheus 0.0.4 text exposition with no extra database to manage.

HMAC-signed Webhooks

21 lifecycle events delivered with X-Sgcsign-Signature: sha256=…. Three-attempt retry queue keeps SIEM, chat, and ticketing systems in sync.

XAdES · PAdES · CAdES

The same engine that ships in the library, exposed through the REST API. Every country profile, every signature level.

XAdES

XML signatures for VeriFactu, FatturaPA, Facturae, KSeF, e-Factura, Peppol, myDATA and EU employment contracts. POST /api/v1/sign/xades.

PAdES

PAdES-Basic PDF signatures with incremental updates that preserve original content. Visible or invisible signatures. POST /api/v1/sign/pades.

CAdES

CMS / PKCS#7 detached or attached signatures for arbitrary binary data. Timestamp + long-term validation. POST /api/v1/sign/cades.

Czech EET 2.0

Builds and signs a registered sale with a key the server holds, optionally posts it to the tax authority and returns the answer. A chain of tills shares one taxpayer certificate. POST /api/v1/sign/eet.

Authenticode, ClickOnce, NuGet, VSIX

The signing daemon talks to whichever cert source you configure: Windows store, PFX, PKCS#11 hardware token, Azure Trusted Signing, AWS KMS, Google KMS.

Authenticode

Sign .exe, .dll, .msi, .cab, .cat, .ocx, .sys. Hash-only mode lets low-bandwidth runners exchange a few dozen bytes for an 8 KB PKCS#7 blob. Add --page-hashes (page_hashes in the API) for page hashes on kernel-mode drivers, like signtool /ph.

ClickOnce

Sign ClickOnce manifests (.application / .manifest) so Windows clients install without trust prompts. POST /api/v1/sign/clickonce.

NuGet Packages

Sign .nupkg packages so the NuGet client validates publisher identity. Author and repository signatures supported. POST /api/v1/sign/nuget.

VSIX Extensions

Sign Visual Studio extension packages so VS Marketplace and the IDE itself accept them as trusted. POST /api/v1/sign/vsix.

Sign from any Windows tool

  • sgcSignKSP.dll is a Windows CNG Key Storage Provider, 32 and 64 bit. The certificate sits in the Windows store and points to the provider, the private key never leaves the server.
  • signtool /sha1, /csp /kc and /seal, PowerShell Set-AuthenticodeSignature, dotnet nuget sign and every other program that signs through CNG use the server key, with no plugin and no change to the tool.
  • sgcsign ksp config stores the server URL and the API key, encrypted with DPAPI. sgcsign ksp sync reads the certificate and its chain from GET /api/v1/keys/{provider}/certificate and links it to the provider, in the user or the machine store.
  • Only the digest goes to the server, through /api/v1/sign/raw. It needs a licensed server and a provider with allow_raw_sign, and a provider that requires approval cannot be used through it.
  • Install it with the optional setup component, from a setup started as administrator, or copy the two DLLs and register them with regsvr32.
sign-with-ksp.cmd
rem Once per machine: store the server and the API key, then install the certificate
sgcsign ksp config --server https://sign.example.com:8443 --apikey %SIGNING_API_KEY%
sgcsign ksp sync --provider release --server https://sign.example.com:8443 --apikey %SIGNING_API_KEY%

rem signtool picks the certificate by the thumbprint that sgcsign ksp list shows
signtool sign /sha1 <thumbprint> /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 MyApp.exe

Security and Access

Stronger sign-in for the admin console and encrypted secrets on disk, so a stolen password or a copied configuration file does not open the signing keys.

Two-factor Sign-in

Console accounts add a 6 digit code from any TOTP authenticator app, with 10 single-use recovery codes for a lost phone. Set admin.require_2fa and every console user must enroll before reaching any other page. An administrator can reset a lost second factor.

OpenID Connect Sign-in

Sign in to the console with Microsoft Entra ID, Okta, Keycloak, Google or any standard OpenID Connect provider, using the authorization code flow with PKCE. Users link an external identity to their account, and new users can optionally request an account that an administrator approves.

Console Hardening

Every response carries security headers and a strict Content Security Policy. A configurable password policy, temporary passwords that must be replaced at the first sign-in, and sessions that end as soon as the role or rights behind them change.

Secrets Encrypted at Rest

Provider passwords, PINs, cloud credentials and webhook secrets are stored encrypted with AES-256-GCM under a master key bound to the machine (DPAPI on Windows). sgcSignServer --protect-secrets encrypts an existing configuration in place.

Signing Control and Timestamps

The server decides who may sign, with which key and after whose approval, and every signature gets a timestamp even when one timestamp server is down.

Enforced Approvals

Mark a provider or a whole project as approval required, and the server refuses direct signing with approval_required. Each approval signs once. The rule holds on every signing path, raw digest signing for signtool /dlib included.

API Key Lifecycle

Regenerate a key while the old secret keeps working for up to 7 days, edit its expiry, see who owns it and limit it to a list of allowed providers. With api_keys.self_service, operators create and manage their own keys within the limits you set. A key can also start its validity at first use: it is valid for N days counted from its first authenticated call, with a required activate-before date so an unused key never stays valid forever. Sub-keys work only once their parent key is activated, activation is recorded in the audit log as apikey.activate, and Community caps both values at 30 days.

PKCS#11 PIN Retry Guard

The server counts incorrect PIN results per token and stops logging in after max_pin_attempts, so a wrong PIN in the configuration never locks a hardware token. The final try is used only with allow_final_pin_try, and an administrator resets the guard from the console.

CLI Saved Profiles

sgcsign config saves the server, provider and other settings in named profiles, and sgcsign auth set-key stores the API key, so build scripts stop repeating them. The Delphi CLI and the .NET tool esegece.sgcsign.cli share the same files.

Timestamps with Automatic Fallback

  • A server-wide list of default RFC 3161 timestamp servers, tried in order until one answers.
  • Per-provider tsa_urls lists, and no_timestamp for a request that must not be timestamped.
  • sgcsign timestamp adds a timestamp to a file that is already Authenticode signed, with the same fallback.
timestamps
# sgcSignServer.conf.json
"timestamp": {
  "servers": ["http://timestamp.digicert.com", "http://timestamp.sectigo.com"],
  "timeout_ms": 30000
}

# Timestamp a file that is already signed
sgcsign timestamp MyApp.exe --tsa http://timestamp.digicert.com --tsa http://timestamp.sectigo.com

Backups, Monitoring and Setup

Run the server for years without surprises: encrypted backups, warnings before a certificate expires, email when something needs a person, and a Windows installer.

Encrypted Scheduled Backups

One archive holds the configuration, the database, the master key and every key and certificate file, encrypted with AES-256-GCM under a passphrase. Archives run on a schedule or from the console, and sgcSignServer --archive restore rebuilds the server on the same machine or moves it to a new one.

Certificate Expiry Monitoring

The signing certificates and the TLS certificate of the server are checked at start and every day. Warnings at 30, 14, 7 and 1 days left show on the dashboard and go out as the cert.expiring webhook, an email and the sgcsign_certificate_not_after_seconds metric.

Email Notifications

Email when an account is locked out, when two-factor authentication or a password changes, when a backup fails or a certificate is about to expire. SMTP with STARTTLS or implicit TLS, and on Windows the mailer needs no OpenSSL libraries.

Windows Installer

sgcSignServer_Setup.exe installs the server as a Windows service, creates the first administrator and opens the firewall port. TLS uses a generated self-signed certificate, an existing PFX file, or plain HTTP for test machines.

How the Pieces Fit Together

A single Windows service terminates TLS, exposes /api/v1 + /admin, and reaches out to the configured key provider on every call. Key material never lives in the database.

Single binary, three interfaces

  • Build agents hit /api/v1 over HTTPS with a bearer API key.
  • Operators log in to /admin in any browser. Bootstrap UI, session cookies, role-based access.
  • Key providers fetched on demand from PFX, Windows store, PKCS#11, Azure TS, AWS KMS, GCloud KMS, Vault, Certum, CSC v2.
  • SQLite database persists users, API keys, audit log, sessions, webhook queue. Never the key material itself.
  • Webhooks fire asynchronously to SIEM and chat systems on every audited event.
topology.txt
                +----------------------------+
                |   Build agents / CI / CLI  |
                +-------------+--------------+
                              |
                              | HTTPS (TLS 1.2/1.3)
                              v
        +-------------------------------------------+
        |   sgcSignServer.exe   (Windows service)   |
        |   /api/v1/*    (signing, verify, health)  |
        |   /admin/*     (web console, sessions)    |
        +---+-----------------+---------------------+
            |                 |                |
            v                 v                v
     +-------------+   +---------------+   +-----------+
     |  SQLite DB  |   | KeyProviders  |   |  Webhooks |
     | (audit/keys)|   | PFX/HSM/KMS   |   | (outbound)|
     +-------------+   +---------------+   +-----------+

One curl Away

A bearer API key, a hash or file upload, and the signed binary streams back to stdout. Authenticode, CAdES, PAdES, XAdES, ClickOnce, NuGet, VSIX share the same shape.

Sign an .exe in one call

  • X-API-Key or Authorization: Bearer, either auth method works.
  • X-Project selects the tenant; the key must be authorised for the project.
  • Response carries X-Sgcsign-Signer-Subject + X-Sgcsign-Duration-Ms for log correlation.
  • Hash-only mode for Authenticode: send the SHA-256, receive a tiny PKCS#7 blob.
sign-binary.sh
# Authenticode-sign MyApp.exe via the REST API
curl -X POST https://sign.example.com/api/v1/sign/authenticode \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Project: production" \
  -F "provider=release" \
  -F "file=@./MyApp.exe" \
  -o MyApp-signed.exe

# Headers returned by the server
# X-Sgcsign-Signer-Subject: CN=ACME Corp, O=ACME, C=US
# X-Sgcsign-Duration-Ms: 312

Three Steps to a Signed Binary

From a fresh Windows host to the first signed artefact in under five minutes.

1

Install

Run the bundled Inno Setup wizard or drop the zip into a folder. The daemon registers itself as a Windows service called sgcSignServer. Bind to :8443 and load your TLS certificate.

2

Configure a Key Provider

Add a provider to sgcSignServer.conf.json: a PFX file, an Azure Trusted Signing account, AWS KMS key, Certum SimplySign user, or any of the other ten key providers. No service restart required.

3

Issue a Token, Call the API

Open /admin/apikeys, click New API key, scope it to a project, copy the token into your CI runner secret. Build agent calls POST /api/v1/sign/authenticode.

Code Signing in a CI/CD Pipeline

The runner holds an API key, not a certificate. Signing is one command after the build, before the release is published.

From any build agent

  • Keep the API key in the runner's secret store. SGCSIGN_SERVER, SGCSIGN_APIKEY and SGCSIGN_PROVIDER keep the server, the key and the provider off the command line.
  • The sgcsign client computes the Authenticode hash locally and uploads only the hash, not the binary. MSI, MSIX and APPX packages are signed from their digest the same way.
  • Runners without the client call the REST API with curl or any HTTP client, described by the OpenAPI 3.1 spec at /api/v1/openapi.json.
  • The same client ships as the .NET tool esegece.sgcsign.cli, sharing saved profiles with the Delphi CLI.
  • Release keys can require an approval first, so a build signs only after an admin or project admin approves the request.
ci-sign.sh
# Sign a NuGet package from any runner with curl
curl -X POST https://sign.example.com:8443/api/v1/sign/nuget \
  -H "X-API-Key: $SGCSIGN_APIKEY" \
  -F "provider=release" \
  -F "file=@MyLib.1.0.0.nupkg" \
  -o MyLib.1.0.0.signed.nupkg

# Check a signed executable, the answer is JSON
curl -X POST https://sign.example.com:8443/api/v1/verify \
  -H "X-API-Key: $SGCSIGN_APIKEY" \
  -F "file=@MyApp-signed.exe" \
  -F "format=authenticode"

Frequently Asked Questions

Remote code signing keeps the signing key on one server instead of on every build machine. A build agent sends the file, or only its hash, to the server over HTTPS with an API key. The server signs it with a key the agent never sees and returns the signed result. With sgcSign Server the key can also live on a hardware token, an HSM or a cloud KMS that the server fronts, so it never exists as a file at all.

Create an API key in /admin/apikeys, scope it to a project and store it as a secret of the CI runner. After the build step, run sgcsign sign -f authenticode -p release -o MyApp-signed.exe MyApp.exe with SGCSIGN_SERVER and SGCSIGN_APIKEY set, or post the file to /api/v1/sign/<format> with curl. The CI/CD section above shows both.

Yes, that is what sgcSign Server is. It runs on a host you control, Windows or Linux. On Windows, sgcSignServer_Setup.exe installs it as a service, creates the first administrator and opens the firewall port. The users, API keys and audit log are stored in a local SQLite database, and key material never lives in that database.

Yes. A provider is a named handle to a signing key, and the server signs with the certificate the provider points at. A certificate enrolled on a hardware token is reached through the Windows certificate store provider, which selects it by thumbprint or subject, or through the PKCS#11 provider for tokens and network HSMs. A certificate held as a file uses the PFX or PEM provider. The PIN retry guard stops after max_pin_attempts, so a wrong PIN in the configuration never locks the token. See all key providers.

Yes, in two ways. The sgcSign Key Storage Provider, sgcSignKSP.dll, links a certificate in the Windows store to a key on the server, so signtool sign /sha1, /csp /kc and /seal work unchanged, and so does every other Windows program that signs through CNG. The /dlib option works with signtool alone and cannot seal. Both send only the digest to the /api/v1/sign/raw endpoint, which returns only the signature value. Because it signs any digest handed to it, raw signing is off by default and turned on one provider at a time with allow_raw_sign. A provider that requires approval refuses raw signing with approval_required, so neither path gets around an approval. See Sign from any Windows tool.

Yes, through the sgcSign Key Storage Provider. After sgcsign ksp sync the certificate is in the Windows store and its key is on the server, so Set-AuthenticodeSignature signs a script with it and dotnet nuget sign --certificate-fingerprint signs a package with it, and the private key is never on the machine. It needs a licensed server and a provider with allow_raw_sign. The server also signs NuGet packages itself through POST /api/v1/sign/nuget, with nothing installed on the build agent.

No. For Authenticode the sgcsign client computes the hash on the build agent by default and sends only that, and the server answers with a small PKCS#7 blob that the client embeds into the file. MSI, MSIX and APPX packages are signed from their digest too, and --upload sends the whole file when you prefer that.

Yes. Add an AzureTS provider with your tenant ID, client ID, account and certificate profile, and the client secret read from an environment variable. Build agents then sign through the server and never hold the Azure credentials. The Azure Trusted Signing guide shows the configuration and the Delphi code.

Yes, for personal use. sgcSign Server Community signs executables with Authenticode from a local REST API on Windows 64-bit, with one certificate provider, plain HTTP and no time limit. Commercial use, TLS, the IP firewall, unlimited providers and the document formats need a registered license. Both are on the download page.

Best value: All-AccessEvery eSeGeCe product, Premium Support included, from €1,059/year.
See All-Access pricing

Centralise Signing Across Your Build Farm

Stop copying signing certificates onto every build agent. One sgcSign Server, one REST endpoint, full audit and approvals.