pg_ecdsa_verify
pg_ecdsa_verify · ECDSA signature verification functions for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100869 | pg_ecdsa_verify | pg_ecdsa_verify | 1.2.4 | SEC | MIT | Rust |
PostgreSQL · 13, 14, 15, 16, 17, 18
Usage
Sources:
- Upstream README and SQL signature
- Extension control file
- Cargo package and PostgreSQL feature matrix
- Rust implementation
pg_ecdsa_verify provides one Rust/pgrx function for ECDSA signature verification. ecdsa_verify.ecdsa_verify(bytea, bytea, bytea, text, text) hashes the payload, verifies the signature against a public key, and returns a Boolean. It supports the secp256r1 and secp256k1 curves and only the sha256 hash selector.
Verify stored signed data
The public key is a raw 64-byte concatenation of the X and Y coordinates, and the signature is a raw 64-byte concatenation of the R and S values. The extension intentionally does not generate keys or create signatures, so private keys need not enter PostgreSQL.
The implementation slices both byte arrays without checking their lengths and panics for unsupported curve/hash names. Validate octet_length(public_key) = 64 and octet_length(signature) = 64 before calling it, and treat malformed input as an error path rather than a false signature. The catalog and Cargo package agree on version 1.2.4; Cargo features cover PostgreSQL 13 through 18. Installation is superuser-only and creates the fixed ecdsa_verify schema.