Skip to content

pg_ssl

Create base64-encoded PKCS#7 signatures from PEM certificates and private keys in PostgreSQL

pg_ssl · Create base64-encoded PKCS#7 signatures from PEM certificates and private keys in PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100189pg_sslpg_ssl1.0SECMITC

Usage

Sources:

pg_ssl exposes one C function, sign(cert text, data text), which uses OpenSSL to create a PKCS#7 signature and returns base64 text. The first argument is parsed for both an X.509 certificate and its private key.

CREATE EXTENSION pg_ssl;
SELECT oid::regprocedure
FROM pg_proc
WHERE oid = 'sign(text,text)'::regprocedure;

Do not paste a production private key into SQL, query logs, monitoring samples, client history, or application parameters. PostgreSQL text values are not a hardware-backed key store, and the function has no key identifier, password callback, certificate-chain policy, or protected signing service boundary.

The upstream README is empty and there are no tests, releases, usage guide, or compatibility matrix. Treat version 1.0 as unreviewed native cryptographic glue. Audit memory handling and OpenSSL compatibility, revoke EXECUTE from PUBLIC, and prefer an external key-management signer for real credentials.

Table reader