OneSignTool CLI — Remote Code Signing Guide

Apr 6, 2026 · 9 views

What is OneSignTool?

OneSignTool is a command-line tool for remote code signing. It allows developers to sign Windows executables (EXE, DLL, MSI, CAB, SYS) from any machine, while the USB hardware token (YubiKey, SafeNet) stays securely connected to a central signing server.

Key benefits:

  • Azure Key Vault compatible — drop-in replacement for AzureSignTool. Same CLI flags, same workflow, but with your own hardware token instead of cloud HSM
  • No per-signature cloud fees — sign unlimited files with your existing code signing certificate
  • USB token stays on server — developers never need physical access to the token
  • CI/CD ready — integrates with GitHub Actions, Azure DevOps, Jenkins, and any build pipeline
  • Signtool compatible — supports standard signtool.exe flags for easy migration

How It Works

  1. Setup: Install OneSigner Service on a Windows machine with your USB token plugged in
  2. Configure: Enable the Azure Key Vault Proxy endpoint in OneSigner settings
  3. Sign: Use OneSignTool (or AzureSignTool) from any machine to sign files remotely

The signing server exposes Azure Key Vault compatible REST endpoints. When OneSignTool sends a signing request, the server uses the local USB token to perform the cryptographic operation and returns the signed hash. The actual file content never leaves your build machine — only the hash is sent to the server.

Installation

Download OneSignTool from the Downloads page. It's a single executable — no installation required.

# Option 1: Download directly
# Visit https://onesign.sg/portal/download

# Option 2: Copy from OneSigner installation
# OneSignTool is included in the OneSigner Service package

Quick Start

1. Sign a file (AzureSignTool-compatible mode)

OneSignTool.exe sign ^
  -kvu http://your-server:9440 ^
  -kvc your-certificate-name ^
  -kva YOUR_ADMIN_TOKEN ^
  -fd sha256 ^
  -tr http://ts.ssl.com ^
  -td sha256 ^
  -d "My Application" ^
  myapp.exe

2. Sign with signtool-compatible flags

hAutoSignerService.exe --codesign ^
  /sha1 THUMBPRINT_HERE ^
  /pin 654321 ^
  /fd sha256 ^
  /tr http://ts.ssl.com ^
  /d "My Application" ^
  myapp.exe

3. Sign multiple files

# Sign all EXE files in a folder
for %%f in (build*.exe) do (
  OneSignTool.exe sign -kvu http://server:9440 -kvc cert-name -kva TOKEN -fd sha256 -tr http://ts.ssl.com "%%f"
)

Command Reference

AzureSignTool-compatible flags

FlagDescriptionExample
-kvuKey Vault URL (OneSigner server address)http://server:9440
-kvcCertificate name (as configured in OneSigner)my-codesign-cert
-kvaAccess token (OneSigner admin token)your-secret-token
-fdFile digest algorithmsha256
-trRFC 3161 timestamp server URLhttp://ts.ssl.com
-tdTimestamp digest algorithmsha256
-dDescription (appears in signature details)"My App v2.0"
-duDescription URLhttps://example.com
-asAppend signature (dual-sign)(no value)
-vVerbose output(no value)

Signtool-compatible flags

FlagDescription
/sha1 <thumbprint>Select certificate by SHA1 thumbprint
/pin <PIN>Hardware token PIN
/f <path>PFX certificate file path
/p <password>PFX file password
/n <subject>Select certificate by subject name
/fd <alg>File digest: sha1, sha256, sha384, sha512
/tr <url>RFC 3161 timestamp server
/td <alg>Timestamp digest algorithm
/t <url>Legacy timestamp URL (Authenticode)
/d <desc>Description string
/du <url>Description URL
/asAppend signature (nested/dual-sign)
/ac <path>Additional certificate (cross-cert)
/phGenerate page hashes
/o <path>Output file (sign to different path)
/vVerbose output

Supported File Types

TypeExtensionsDescription
Executable.exe, .dll, .ocx, .sysWindows PE files
Installer.msi, .msix, .appxWindows Installer packages
Cabinet.cabCabinet archives
Catalog.catSecurity catalog files
PowerShell.ps1, .psm1, .psd1PowerShell scripts

Supported Hardware Tokens

TokenSigning MethodNotes
YubiKey 4/5 SeriesPIV direct signing (fastest)No Windows CSP required. Supports ECDSA P-256, P-384 and RSA 2048
SafeNet eToken 5110/5300Windows CSPInstall SafeNet Authentication Client driver
ePass2003Windows CSPCommon in  Local CAs
Any PKCS#11 tokenWindows CSP/CNGRequires vendor minidriver installed

Supported Signing Algorithms

AlgorithmIDUse Case
RSA PKCS#1 v1.5RS256, RS384, RS512Most common, widest compatibility
RSA PSSPS256, PS384, PS512Modern RSA padding scheme
ECDSAES256, ES384, ES512Smaller signatures, faster — YubiKey P-256, P-384

CI/CD Integration

GitHub Actions

- name: Sign executable
  run: |
    OneSignTool.exe sign 
      -kvu ${{ secrets.SIGNING_SERVER }} 
      -kvc ${{ secrets.CERT_NAME }} 
      -kva ${{ secrets.SIGNING_TOKEN }} 
      -fd sha256 
      -tr http://ts.ssl.com
      -td sha256 
      build/myapp.exe

Azure DevOps Pipeline

- task: CmdLine@2
  displayName: 'Code Sign'
  inputs:
    script: |
      OneSignTool.exe sign ^
        -kvu $(SIGNING_SERVER) ^
        -kvc $(CERT_NAME) ^
        -kva $(SIGNING_TOKEN) ^
        -fd sha256 ^
        -tr http://ts.ssl.com ^
        buildmyapp.exe

Jenkins / Generic Script

#!/bin/bash
# Sign all EXE and DLL files after build
find ./build -name "*.exe" -o -name "*.dll" | while read f; do
  ./OneSignTool sign -kvu $SIGNING_SERVER -kvc $CERT_NAME -kva $SIGNING_TOKEN -fd sha256 -tr http://timestamp.digicert.com "$f"
done

Server-Side Configuration

On the OneSigner server, configure the Azure Key Vault Proxy in appsettings.json:

{
  "AzureKeyVaultProxy": {
    "Enabled": true,
    "Certificates": [
      {
        "Name": "my-codesign-cert",
        "CertificateSerial": "ABC123DEF456...",
        "TokenPin": "654321",
        "Description": "EV Code Signing Certificate"
      }
    ]
  }
}

The Name field is what you pass as -kvc in OneSignTool. The server maps it to the correct USB token and PIN automatically.

Security Best Practices

  • Use Cloudflare Tunnel — never expose port 9440 directly to the internet. OneSigner has built-in Cloudflare Tunnel support for secure remote access
  • Rotate admin tokens — use unique tokens per CI/CD pipeline. Revoke tokens when no longer needed
  • Enable audit logging — OneSigner logs all signing operations with timestamps, file hashes, and requestor IP
  • Hardware token PIN protection — PINs are encrypted with DPAPI in appsettings.json. The token locks after failed attempts
  • Network isolation — run the signing server on a dedicated machine or VM, separate from build infrastructure

Troubleshooting

Connection refused

Ensure OneSigner Service is running and the port matches. Check Windows Firewall allows inbound on port 9440.

Certificate not found

Verify the certificate name in -kvc matches the Name field in server's appsettings.json. The USB token must be plugged in.

Signing failed: token PIN incorrect

Check the PIN in server config. Note: most tokens lock after 3 failed PIN attempts. OneSigner has built-in PIN retry protection to prevent lockout.

Timestamp failed

Timestamp servers may be temporarily unavailable. Common reliable servers:

  • http://ts.ssl.com
  • http://timestamp.digicert.com
  • http://timestamp.sectigo.com
  • http://timestamp.globalsign.com/tsa/r6advanced1

Comparison: OneSignTool vs Cloud Signing

FeatureOneSignTool + OneSignerAzure Key Vault / Cloud HSM
Monthly cost$0 (one-time license)$50-500+/month
Per-signature feeNone$0.03-0.15 per operation
Certificate storageYour own USB tokenCloud HSM (vendor lock-in)
Signing speed~100-500ms200-1000ms (network latency)
Offline capabilityYes (local network)No (cloud required)
AzureSignTool compatibleYesYes (native)
EV Code SigningYes (hardware token)Yes (cloud HSM)