Skip to content

libx509pq

X.509 certificate parsing and inspection through OpenSSL

libx509pq · X.509 certificate parsing and inspection through OpenSSL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
7420libx509pqlibx509pq1.3SECGPL-3.0-or-laterC
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno
Relationships
See Alsosslinfo 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

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.319 18 17 16 15libx509pq-
RPMPIGSTY1.319 18 17 16 15libx509pq_$vopenssl-libs
DEBPIGSTY1.319 18 17 16 15postgresql-$v-libx509pq-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
el8.aarch64N/APIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
el9.x86_64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
el9.aarch64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
el10.x86_64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
el10.aarch64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
d12.x86_64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
d12.aarch64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
d13.x86_64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
d13.aarch64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
u22.x86_64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
u22.aarch64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
u24.x86_64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
u24.aarch64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
u26.x86_64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
u26.aarch64PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3PIGSTY 1.3
PackageVersionOSORGSIZEFile URL
libx509pq_191.3el9.x86_64pigsty92.1 KiBlibx509pq_19-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_191.3el9.aarch64pigsty92.1 KiBlibx509pq_19-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_191.3el10.x86_64pigsty93.2 KiBlibx509pq_19-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_191.3el10.aarch64pigsty92.4 KiBlibx509pq_19-1.3-1PGSTY.el10.aarch64.rpm
postgresql-19-libx509pq1.3d12.x86_64pigsty81.7 KiBpostgresql-19-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-19-libx509pq1.3d12.aarch64pigsty81.0 KiBpostgresql-19-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-19-libx509pq1.3d13.x86_64pigsty81.6 KiBpostgresql-19-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-19-libx509pq1.3d13.aarch64pigsty80.8 KiBpostgresql-19-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-19-libx509pq1.3u22.x86_64pigsty88.1 KiBpostgresql-19-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-19-libx509pq1.3u22.aarch64pigsty87.7 KiBpostgresql-19-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-19-libx509pq1.3u24.x86_64pigsty85.6 KiBpostgresql-19-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-19-libx509pq1.3u24.aarch64pigsty85.5 KiBpostgresql-19-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-19-libx509pq1.3u26.x86_64pigsty85.0 KiBpostgresql-19-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-19-libx509pq1.3u26.aarch64pigsty84.5 KiBpostgresql-19-libx509pq_1.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
libx509pq_181.3el8.x86_64pigsty92.0 KiBlibx509pq_18-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_181.3el8.aarch64pigsty91.0 KiBlibx509pq_18-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_181.3el9.x86_64pigsty92.1 KiBlibx509pq_18-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_181.3el9.aarch64pigsty92.1 KiBlibx509pq_18-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_181.3el10.x86_64pigsty93.1 KiBlibx509pq_18-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_181.3el10.aarch64pigsty92.4 KiBlibx509pq_18-1.3-1PGSTY.el10.aarch64.rpm
postgresql-18-libx509pq1.3d12.x86_64pigsty81.6 KiBpostgresql-18-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-18-libx509pq1.3d12.aarch64pigsty80.9 KiBpostgresql-18-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-18-libx509pq1.3d13.x86_64pigsty81.5 KiBpostgresql-18-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-18-libx509pq1.3d13.aarch64pigsty80.6 KiBpostgresql-18-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-18-libx509pq1.3u22.x86_64pigsty87.9 KiBpostgresql-18-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-18-libx509pq1.3u22.aarch64pigsty87.5 KiBpostgresql-18-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-18-libx509pq1.3u24.x86_64pigsty85.4 KiBpostgresql-18-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-18-libx509pq1.3u24.aarch64pigsty85.4 KiBpostgresql-18-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-18-libx509pq1.3u26.x86_64pigsty85.1 KiBpostgresql-18-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-18-libx509pq1.3u26.aarch64pigsty84.5 KiBpostgresql-18-libx509pq_1.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
libx509pq_171.3el8.x86_64pigsty92.0 KiBlibx509pq_17-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_171.3el8.aarch64pigsty91.0 KiBlibx509pq_17-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_171.3el9.x86_64pigsty92.3 KiBlibx509pq_17-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_171.3el9.aarch64pigsty92.2 KiBlibx509pq_17-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_171.3el10.x86_64pigsty93.3 KiBlibx509pq_17-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_171.3el10.aarch64pigsty92.5 KiBlibx509pq_17-1.3-1PGSTY.el10.aarch64.rpm
postgresql-17-libx509pq1.3d12.x86_64pigsty81.6 KiBpostgresql-17-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-17-libx509pq1.3d12.aarch64pigsty80.8 KiBpostgresql-17-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-17-libx509pq1.3d13.x86_64pigsty81.4 KiBpostgresql-17-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-17-libx509pq1.3d13.aarch64pigsty80.7 KiBpostgresql-17-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-17-libx509pq1.3u22.x86_64pigsty102.2 KiBpostgresql-17-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-17-libx509pq1.3u22.aarch64pigsty101.6 KiBpostgresql-17-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-17-libx509pq1.3u24.x86_64pigsty85.4 KiBpostgresql-17-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-17-libx509pq1.3u24.aarch64pigsty85.4 KiBpostgresql-17-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-17-libx509pq1.3u26.x86_64pigsty85.1 KiBpostgresql-17-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-17-libx509pq1.3u26.aarch64pigsty84.5 KiBpostgresql-17-libx509pq_1.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
libx509pq_161.3el8.x86_64pigsty92.0 KiBlibx509pq_16-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_161.3el8.aarch64pigsty91.0 KiBlibx509pq_16-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_161.3el9.x86_64pigsty92.3 KiBlibx509pq_16-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_161.3el9.aarch64pigsty92.2 KiBlibx509pq_16-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_161.3el10.x86_64pigsty93.2 KiBlibx509pq_16-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_161.3el10.aarch64pigsty92.5 KiBlibx509pq_16-1.3-1PGSTY.el10.aarch64.rpm
postgresql-16-libx509pq1.3d12.x86_64pigsty81.6 KiBpostgresql-16-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-16-libx509pq1.3d12.aarch64pigsty80.8 KiBpostgresql-16-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-16-libx509pq1.3d13.x86_64pigsty81.5 KiBpostgresql-16-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-16-libx509pq1.3d13.aarch64pigsty80.7 KiBpostgresql-16-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-16-libx509pq1.3u22.x86_64pigsty101.4 KiBpostgresql-16-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-16-libx509pq1.3u22.aarch64pigsty100.8 KiBpostgresql-16-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-16-libx509pq1.3u24.x86_64pigsty85.4 KiBpostgresql-16-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-16-libx509pq1.3u24.aarch64pigsty85.5 KiBpostgresql-16-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-16-libx509pq1.3u26.x86_64pigsty85.1 KiBpostgresql-16-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-16-libx509pq1.3u26.aarch64pigsty84.5 KiBpostgresql-16-libx509pq_1.3-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
libx509pq_151.3el8.x86_64pigsty92.2 KiBlibx509pq_15-1.3-1PGSTY.el8.x86_64.rpm
libx509pq_151.3el8.aarch64pigsty91.0 KiBlibx509pq_15-1.3-1PGSTY.el8.aarch64.rpm
libx509pq_151.3el9.x86_64pigsty92.8 KiBlibx509pq_15-1.3-1PGSTY.el9.x86_64.rpm
libx509pq_151.3el9.aarch64pigsty92.6 KiBlibx509pq_15-1.3-1PGSTY.el9.aarch64.rpm
libx509pq_151.3el10.x86_64pigsty93.7 KiBlibx509pq_15-1.3-1PGSTY.el10.x86_64.rpm
libx509pq_151.3el10.aarch64pigsty93.0 KiBlibx509pq_15-1.3-1PGSTY.el10.aarch64.rpm
postgresql-15-libx509pq1.3d12.x86_64pigsty81.9 KiBpostgresql-15-libx509pq_1.3-1PGSTY~bookworm_amd64.deb
postgresql-15-libx509pq1.3d12.aarch64pigsty81.2 KiBpostgresql-15-libx509pq_1.3-1PGSTY~bookworm_arm64.deb
postgresql-15-libx509pq1.3d13.x86_64pigsty81.9 KiBpostgresql-15-libx509pq_1.3-1PGSTY~trixie_amd64.deb
postgresql-15-libx509pq1.3d13.aarch64pigsty80.8 KiBpostgresql-15-libx509pq_1.3-1PGSTY~trixie_arm64.deb
postgresql-15-libx509pq1.3u22.x86_64pigsty101.9 KiBpostgresql-15-libx509pq_1.3-1PGSTY~jammy_amd64.deb
postgresql-15-libx509pq1.3u22.aarch64pigsty101.3 KiBpostgresql-15-libx509pq_1.3-1PGSTY~jammy_arm64.deb
postgresql-15-libx509pq1.3u24.x86_64pigsty85.9 KiBpostgresql-15-libx509pq_1.3-1PGSTY~noble_amd64.deb
postgresql-15-libx509pq1.3u24.aarch64pigsty86.0 KiBpostgresql-15-libx509pq_1.3-1PGSTY~noble_arm64.deb
postgresql-15-libx509pq1.3u26.x86_64pigsty85.6 KiBpostgresql-15-libx509pq_1.3-1PGSTY~resolute_amd64.deb
postgresql-15-libx509pq1.3u26.aarch64pigsty85.0 KiBpostgresql-15-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 by package name

pig install libx509pq -v 19;   # install for PG 19
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

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.

Table reader