Back to home
Back to documentation

Signing Service

The Signing Service is a key component of the Quantum-Safe PKI project, providing a way to sign software artifacts with hybrid signatures that combine classical and post-quantum cryptography. This ensures that signed artifacts remain verifiable even in the presence of quantum computers.

Key Features

  • Signs arbitrary artifact hashes using a hybrid ECDSA + EdDilithium2 signature scheme, providing both classical and post-quantum security.
  • Requires authentication via API Keys (X-API-Key header) for secure access control.
  • Implements rate limiting for a 'free' tier, with higher limits for paid plans.
  • Stores signing logs, SBOMs (Software Bill of Materials), and provenance information in a SQLite database for auditability.
  • Provides endpoints for account creation, signing, and log retrieval.
  • Supports mutual TLS (mTLS) with CRL checks for enhanced security.
  • Flexible key storage options: filesystem (fs) or PKCS#11 hardware security modules (pkcs11).

API Endpoints

EndpointMethodDescriptionAuthentication
/v1/accountsPOSTCreates a new account and returns an API keyNone
/v1/accounts/{accountID}GETReturns account usage informationAPI Key
/v1/signaturesPOSTSigns an artifact hash and returns the signatureAPI Key
/v1/log/{entryID}GETReturns a specific log entryNone
/v1/log/{entryID}/sbomGETReturns the SBOM for a specific log entryNone
/v1/log/{entryID}/provenanceGETReturns the provenance for a specific log entryNone
/v1/logGETLists log entries with paginationNone
/metricsGETPrometheus metrics endpointNone
/healthzGETHealth check endpointNone
/readyzGETReadiness check endpointNone

Configuration

The Signing Service is configured primarily through environment variables:

VariableDescriptionDefault
SIGNING_ADDR / ADDRListen address for the service:7000
DB_DSNSQLite database file pathsigning.db
KEY_DIRDirectory to store/load cryptographic keys and certificateskeys
KEYSTORE_TYPEMethod for storing private keys: fs or pkcs11fs
CA_CERT_FILEPath to the CA root certificate PEM fileca-cert.pem
CA_CRL_URLURL to fetch the Certificate Revocation List from the CAhttps://localhost:5000/crl

Key Files

The Signing Service uses the following key files, stored in the directory specified by KEY_DIR:

  • ecdsa: ECDSA Private Key for classical signatures
  • pqc-key.bin: EdDilithium2 Private Key for post-quantum signatures
  • tls: ECDSA Private Key for TLS
  • tls: Certificate for TLS

Usage Examples

Creating an Account

curl -X POST https://localhost:7000/v1/accounts

Signing an Artifact

curl -X POST \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{"artifactHash": "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "algorithm": "hybrid"}' \
https://localhost:7000/v1/signatures

Retrieving a Log Entry

curl https://localhost:7000/v1/log/12345

CLI Integration

The Signing Service is designed to be used with the provided CLI tool, which simplifies the process of signing artifacts:

# Sign a file
./bin/cli sign \
--api-key your-api-key \
--file path/to/artifact.bin \
--url https://localhost:7000

# Sign a file with SBOM
./bin/cli sign \
--api-key your-api-key \
--file path/to/artifact.bin \
--sbom path/to/sbom.json \
--url https://localhost:7000

Next Steps

Now that you understand the Signing Service, you might want to explore:

  • Transparency Log: Learn about the Transparency Log that records certificate issuance.
  • Authentication: Understand how authentication works across the services.
  • API Endpoints: Review the API endpoints provided by each service.