Skip to content

libx509pq

X.509 certificate parsing and inspection through OpenSSL

libx509pq : X.509 certificate parsing and inspection through OpenSSL

Overview

ID Extension Package Version Category License Language
7420 libx509pq libx509pq 1.3 SEC GPL-3.0-or-later C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r No Yes No Yes yes no
Relationships
See Also sslinfo sslutils pg_snakeoil pgcrypto
Requires OpenSSL 1.1.1+; GPL-3.0-or-later is explicit in source headers. EL9 default crypto policy rejects a legacy SHA-1 test fixture; SHA-256 verification passed without changing policy.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 1.3 18 17 16 15 14 libx509pq -
RPM PIGSTY 1.3 18 17 16 15 14 libx509pq_$v openssl-libs
DEB PIGSTY 1.3 18 17 16 15 14 postgresql-$v-libx509pq -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
el8.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
el9.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
el9.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
el10.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
el10.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
d12.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
d12.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
d13.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
d13.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
u22.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
u22.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
u24.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
u24.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
u26.x86_64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
u26.aarch64 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3 PIGSTY 1.3
Package Version OS ORG SIZE File URL
libx509pq_18 1.3 el8.x86_64 pigsty 92.2 KiB libx509pq_18-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_18 1.3 el8.aarch64 pigsty 91.2 KiB libx509pq_18-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_18 1.3 el9.x86_64 pigsty 92.8 KiB libx509pq_18-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_18 1.3 el9.aarch64 pigsty 92.4 KiB libx509pq_18-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_18 1.3 el10.x86_64 pigsty 93.1 KiB libx509pq_18-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_18 1.3 el10.aarch64 pigsty 92.4 KiB libx509pq_18-1.3-1PGSTY.el10.aarch64.rpm
postgresql-18-libx509pq 1.3 d12.x86_64 pigsty 76.6 KiB postgresql-18-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-18-libx509pq 1.3 d12.aarch64 pigsty 75.9 KiB postgresql-18-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-18-libx509pq 1.3 d13.x86_64 pigsty 76.5 KiB postgresql-18-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-18-libx509pq 1.3 d13.aarch64 pigsty 75.7 KiB postgresql-18-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-18-libx509pq 1.3 u22.x86_64 pigsty 83.0 KiB postgresql-18-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-18-libx509pq 1.3 u22.aarch64 pigsty 82.5 KiB postgresql-18-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-18-libx509pq 1.3 u24.x86_64 pigsty 80.5 KiB postgresql-18-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-18-libx509pq 1.3 u24.aarch64 pigsty 80.5 KiB postgresql-18-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-18-libx509pq 1.3 u26.x86_64 pigsty 80.2 KiB postgresql-18-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-18-libx509pq 1.3 u26.aarch64 pigsty 79.6 KiB postgresql-18-libx509pq_1.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
libx509pq_17 1.3 el8.x86_64 pigsty 92.2 KiB libx509pq_17-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_17 1.3 el8.aarch64 pigsty 91.2 KiB libx509pq_17-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_17 1.3 el9.x86_64 pigsty 93.0 KiB libx509pq_17-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_17 1.3 el9.aarch64 pigsty 92.5 KiB libx509pq_17-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_17 1.3 el10.x86_64 pigsty 93.2 KiB libx509pq_17-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_17 1.3 el10.aarch64 pigsty 92.6 KiB libx509pq_17-1.3-1PGSTY.el10.aarch64.rpm
postgresql-17-libx509pq 1.3 d12.x86_64 pigsty 76.6 KiB postgresql-17-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-17-libx509pq 1.3 d12.aarch64 pigsty 75.9 KiB postgresql-17-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-17-libx509pq 1.3 d13.x86_64 pigsty 76.5 KiB postgresql-17-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-17-libx509pq 1.3 d13.aarch64 pigsty 75.7 KiB postgresql-17-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-17-libx509pq 1.3 u22.x86_64 pigsty 97.2 KiB postgresql-17-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-17-libx509pq 1.3 u22.aarch64 pigsty 96.6 KiB postgresql-17-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-17-libx509pq 1.3 u24.x86_64 pigsty 80.6 KiB postgresql-17-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-17-libx509pq 1.3 u24.aarch64 pigsty 80.6 KiB postgresql-17-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-17-libx509pq 1.3 u26.x86_64 pigsty 80.2 KiB postgresql-17-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-17-libx509pq 1.3 u26.aarch64 pigsty 79.7 KiB postgresql-17-libx509pq_1.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
libx509pq_16 1.3 el8.x86_64 pigsty 92.2 KiB libx509pq_16-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_16 1.3 el8.aarch64 pigsty 91.2 KiB libx509pq_16-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_16 1.3 el9.x86_64 pigsty 93.0 KiB libx509pq_16-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_16 1.3 el9.aarch64 pigsty 92.5 KiB libx509pq_16-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_16 1.3 el10.x86_64 pigsty 93.2 KiB libx509pq_16-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_16 1.3 el10.aarch64 pigsty 92.6 KiB libx509pq_16-1.3-1PGSTY.el10.aarch64.rpm
postgresql-16-libx509pq 1.3 d12.x86_64 pigsty 76.6 KiB postgresql-16-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-16-libx509pq 1.3 d12.aarch64 pigsty 75.9 KiB postgresql-16-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-16-libx509pq 1.3 d13.x86_64 pigsty 76.5 KiB postgresql-16-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-16-libx509pq 1.3 d13.aarch64 pigsty 75.7 KiB postgresql-16-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-16-libx509pq 1.3 u22.x86_64 pigsty 96.4 KiB postgresql-16-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-16-libx509pq 1.3 u22.aarch64 pigsty 95.8 KiB postgresql-16-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-16-libx509pq 1.3 u24.x86_64 pigsty 80.6 KiB postgresql-16-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-16-libx509pq 1.3 u24.aarch64 pigsty 80.6 KiB postgresql-16-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-16-libx509pq 1.3 u26.x86_64 pigsty 80.3 KiB postgresql-16-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-16-libx509pq 1.3 u26.aarch64 pigsty 79.6 KiB postgresql-16-libx509pq_1.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
libx509pq_15 1.3 el8.x86_64 pigsty 92.4 KiB libx509pq_15-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_15 1.3 el8.aarch64 pigsty 91.3 KiB libx509pq_15-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_15 1.3 el9.x86_64 pigsty 93.6 KiB libx509pq_15-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_15 1.3 el9.aarch64 pigsty 92.9 KiB libx509pq_15-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_15 1.3 el10.x86_64 pigsty 93.7 KiB libx509pq_15-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_15 1.3 el10.aarch64 pigsty 93.0 KiB libx509pq_15-1.3-1PGSTY.el10.aarch64.rpm
postgresql-15-libx509pq 1.3 d12.x86_64 pigsty 77.0 KiB postgresql-15-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-15-libx509pq 1.3 d12.aarch64 pigsty 76.2 KiB postgresql-15-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-15-libx509pq 1.3 d13.x86_64 pigsty 76.9 KiB postgresql-15-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-15-libx509pq 1.3 d13.aarch64 pigsty 75.9 KiB postgresql-15-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-15-libx509pq 1.3 u22.x86_64 pigsty 96.9 KiB postgresql-15-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-15-libx509pq 1.3 u22.aarch64 pigsty 96.3 KiB postgresql-15-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-15-libx509pq 1.3 u24.x86_64 pigsty 81.1 KiB postgresql-15-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-15-libx509pq 1.3 u24.aarch64 pigsty 81.1 KiB postgresql-15-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-15-libx509pq 1.3 u26.x86_64 pigsty 80.7 KiB postgresql-15-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-15-libx509pq 1.3 u26.aarch64 pigsty 80.1 KiB postgresql-15-libx509pq_1.3-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
libx509pq_14 1.3 el8.x86_64 pigsty 92.2 KiB libx509pq_14-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_14 1.3 el8.aarch64 pigsty 91.2 KiB libx509pq_14-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_14 1.3 el9.x86_64 pigsty 93.5 KiB libx509pq_14-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_14 1.3 el9.aarch64 pigsty 92.8 KiB libx509pq_14-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_14 1.3 el10.x86_64 pigsty 93.6 KiB libx509pq_14-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_14 1.3 el10.aarch64 pigsty 92.9 KiB libx509pq_14-1.3-1PGSTY.el10.aarch64.rpm
postgresql-14-libx509pq 1.3 d12.x86_64 pigsty 81.9 KiB postgresql-14-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-14-libx509pq 1.3 d12.aarch64 pigsty 81.1 KiB postgresql-14-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-14-libx509pq 1.3 d13.x86_64 pigsty 81.8 KiB postgresql-14-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-14-libx509pq 1.3 d13.aarch64 pigsty 80.8 KiB postgresql-14-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-14-libx509pq 1.3 u22.x86_64 pigsty 99.4 KiB postgresql-14-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-14-libx509pq 1.3 u22.aarch64 pigsty 98.9 KiB postgresql-14-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-14-libx509pq 1.3 u24.x86_64 pigsty 85.8 KiB postgresql-14-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-14-libx509pq 1.3 u24.aarch64 pigsty 86.0 KiB postgresql-14-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-14-libx509pq 1.3 u26.x86_64 pigsty 85.5 KiB postgresql-14-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-14-libx509pq 1.3 u26.aarch64 pigsty 85.0 KiB postgresql-14-libx509pq_1.3-1PGSTY~resolute_arm64.deb

Source

pig build pkg libx509pq;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install libx509pq;		# install via package name, for the active PG version

pig install libx509pq -v 18;   # install for PG 18
pig install libx509pq -v 17;   # install for PG 17
pig install libx509pq -v 16;   # install for PG 16
pig install libx509pq -v 15;   # install for PG 15
pig install libx509pq -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION libx509pq;

Usage

Sources:

libx509pq exposes OpenSSL X.509 certificate parsing to SQL. It accepts DER certificates as bytea and extracts subject, issuer, validity, serial number, key and signature information, extensions, alternate names, fingerprints, and related fields.

CREATE EXTENSION libx509pq;
SELECT x509_commonName(der),
       x509_issuerName(der),
       x509_notBefore(der),
       x509_notAfter(der),
       x509_keyAlgorithm(der),
       x509_keySize(der)
FROM certificate_store;

For multiple basic fields, x509_basic_info(der) avoids parsing the same certificate repeatedly. Other APIs enumerate extensions and names, expose public keys, identify selected weak-key patterns, and verify one certificate signature against a supplied key.

Parsing or signature verification is not full PKIX path validation: it does not by itself establish trust, hostname validity, revocation status, policy, or current acceptability. Malformed DER reaches native OpenSSL code; cap input size, fuzz and regression-test untrusted corpora, and keep PostgreSQL and OpenSSL patched. Pin the OpenSSL ABI used at build and runtime, review sentinel-versus-null error behavior, restrict expensive functions, and benchmark bulk parsing.