pgcryptokey
cryptographic key management
pgcryptokey : cryptographic key management
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 7320 | pgcryptokey | pgcryptokey | 0.85 |
SEC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| Requires | pgcrypto |
| See Also | pgsodium column_encrypt supabase_vault pg_enigma pg_tde pgcrypto shacrypt cryptint pguecc pgsmcrypto |
missing 14 on el pgdg repo
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | MIXED | 0.85 |
18 17 16 15 14 | pgcryptokey |
pgcrypto |
| RPM | PIGSTY | 0.85 |
18 17 16 15 14 | pgcryptokey_$v |
- |
| DEB | PIGSTY | 0.85 |
18 17 16 15 14 | postgresql-$v-pgcryptokey |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 |
| el8.aarch64 | PIGSTY 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 |
| el9.x86_64 | PIGSTY 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 |
| el9.aarch64 | PIGSTY 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 |
| el10.x86_64 | PIGSTY 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 |
| el10.aarch64 | PIGSTY 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 | PGDG 0.85 |
| d12.x86_64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| d12.aarch64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| d13.x86_64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| d13.aarch64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| u22.x86_64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| u22.aarch64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| u24.x86_64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| u24.aarch64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| u26.x86_64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
| u26.aarch64 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 | PIGSTY 0.85 |
Source
momjian.us/download/pgcryptokey/
pgcryptokey-0.85.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
pgcryptokey manages cryptographic data encryption keys within PostgreSQL. Keys are stored encrypted and secured by access passwords, supporting both system-wide and per-session key access.
Key Management Functions
| Function | Description |
|---|---|
create_cryptokey(name, byte_len) |
Generate a new cryptographic key |
set_cryptokey(name) |
Set the active key for operations |
get_cryptokey(name) |
Retrieve key material |
drop_cryptokey(name) |
Remove a key |
supersede_cryptokey() |
Rotate to a new key (same access password) |
change_key_access_password() |
Update key authentication credentials |
reencrypt_data() |
Re-encrypt data with a different key |
Session Control
| Function | Description |
|---|---|
get_shared_key() |
Establish client/server shared secret (SSL/Unix only) |
set_session_access_password() |
Client-supplied password authentication |
Typical Workflow
Access passwords can be configured at database boot time for system-wide access, or per-session by individual clients for granular security control.