Databases
Prepare PostgreSQL, MariaDB or SQL Server for Signing Server with separate migration and runtime accounts and minimal grants.
Signing Server stores transaction state and audit evidence in the database you select with database.engine. This page describes how to prepare each engine. The server never creates accounts, grants privileges or repairs a database, and it never falls back to another engine.
Supported engines
Section titled “Supported engines”| Engine | Version | JDBC driver |
|---|---|---|
postgresql |
PostgreSQL 17 and 18 | org.postgresql:postgresql 42.7.13 |
mariadb |
MariaDB 12.3 | org.mariadb.jdbc:mariadb-java-client 3.5.11 |
sqlserver |
SQL Server 2025 (17.0) at compatibility level 170 | com.microsoft.sqlserver:mssql-jdbc 13.6.0 |
mysql, mssql and azure-sql are rejected, as are editions and versions outside the supported engine list. Connections use ssl_mode verify-full with a ca_file, except for a database on 127.0.0.1, where disable is accepted. No JDBC URL or driver option can be supplied.
Accounts
Section titled “Accounts”| Engine | Accounts |
|---|---|
| PostgreSQL | DSS, seal and timestamp can use one shared account or separate accounts. CSC and dynamic person signing require distinct migration/runtime accounts. |
| MariaDB | Separate migration and runtime accounts are required. |
| SQL Server | Separate migration and runtime accounts are required. SQL Server user names are limited to 128 characters. |
The migration account creates and alters the schema. The runtime account is what the running service uses, and it can neither delete rows nor change the schema. Each service mode keeps its own tables and migration history, so human signing, organization seal and time stamping do not share them.
| Mode | Transaction table | Audit table | History table |
|---|---|---|---|
| Human signing | signing_transaction |
signing_audit |
signing_schema_history |
| Organization seal | organization_seal_transaction |
organization_seal_audit |
organization_seal_schema_history |
| Time stamping | timestamp_transaction |
timestamp_audit |
timestamp_schema_history |
Additional CSC and enrollment state
Section titled “Additional CSC and enrollment state”CSC uses the canonical signing transaction/audit tables plus dedicated csc_oauth_record, csc_oauth_mutex and csc_oauth_schema_history tables. Its runtime needs SELECT, INSERT, UPDATE on the record table, SELECT, UPDATE on the mutex, and SELECT on OAuth history. Prepare both schema families with the exact packaged runtime before startup; never rewrite a history checksum to adopt another artifact.
Optional external PKI has its own enrollment/activation state and versioned schema. Prepare it with the configured migration account before enabling the selected lifecycle. Preserve its consumption, activation and retirement evidence alongside the signing state. See External PKI and certificate issuance.
PostgreSQL
Section titled “PostgreSQL”Create the database and the accounts, and set the connection in database. With a shared account the server runs migrations and operates with that account. The Docker Compose model in Container can also create the roles signing_owner and signing_runtime for a new empty cluster.
MariaDB
Section titled “MariaDB”-
Create an empty dedicated database and two authenticated accounts. Grant the migration account exactly
SELECT, INSERT, UPDATE, CREATE, ALTER, INDEX, REFERENCES, TRIGGER, EVENT, ALTER ROUTINEon that database, with no grant option, global or role privileges. -
Run the schema preparation with the migration account:
Terminal window bin/signing-server config-check /owned/configuration/server.jsonbin/signing-server schema-prepare /owned/configuration/server.json -
Grant the runtime account
SELECT, INSERT, UPDATEon the transaction table,SELECT, INSERTon the audit table andSELECTon the history table of the mode you run. -
Verify with
database-checkand start the server.
MariaDB cannot grant on tables that do not exist, which is why the runtime grants follow the preparation. The server rejects additional inherited, column-level, role or PUBLIC grants.
SQL Server
Section titled “SQL Server”Create a dedicated database with the collation Latin1_General_100_BIN2, in READ_WRITE and MULTI_USER mode, with AUTO_CLOSE, AUTO_SHRINK, TRUSTWORTHY, DB_CHAINING, containment, read committed snapshot, snapshot isolation and delayed durability off. Create two SQL logins with protected tooling and a user for each:
CREATE DATABASE [signing] COLLATE Latin1_General_100_BIN2;USE [signing];CREATE USER [signing_schema] FOR LOGIN [signing_schema] WITH DEFAULT_SCHEMA=[dbo];CREATE USER [signing_runtime] FOR LOGIN [signing_runtime] WITH DEFAULT_SCHEMA=[dbo];GRANT CONNECT, VIEW DEFINITION TO [signing_schema];GRANT CONNECT, VIEW DEFINITION TO [signing_runtime];GRANT CREATE TABLE TO [signing_schema];GRANT ALTER, REFERENCES, SELECT, INSERT, UPDATE ON SCHEMA::dbo TO [signing_schema];Run schema-prepare with the migration account. Then grant the runtime account its object permissions, repeated for each prefix you run (signing, organization_seal or timestamp):
GRANT SELECT, INSERT, UPDATE ON OBJECT::dbo.[signing_transaction] TO [signing_runtime];GRANT SELECT, INSERT ON OBJECT::dbo.[signing_audit] TO [signing_runtime];GRANT SELECT ON OBJECT::dbo.[signing_schema_history] TO [signing_runtime];Neither account may own objects, have additional roles or server grants, or be mapped into another database. Startup checks the profile and rejects a changed one. Do not broaden permissions to get past a failed check.
Schema preparation and startup
Section titled “Schema preparation and startup”schema-prepare applies the packaged migrations with checksums in one transaction. A failure rolls back both the history and the schema, and an uncertain commit is reported as unavailable and not replayed. start applies and verifies pending migrations before it reports readiness. Unknown, partial or altered histories are never adopted or repaired.
Backup and restore
Section titled “Backup and restore”Back up the transaction, audit and history tables together with the configuration and the key material, and keep consumed request IDs. Restore only into a separately approved empty target, and only into the same engine. Never use automatic replacement, repair, deletion of IDs or retry of an uncertain signature. A restored backup does not show that the database is current, so investigate uncertain operations before you resume traffic.