vastbase_sm4
SM4 encryption/decryption functions for VastBase using Java implementation via JNI
vastbase_sm4 · SM4 encryption/decryption functions for VastBase using Java implementation via JNI
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101826 | vastbase_sm4 | vastbase_sm4 | 1.0 | SEC | MIT | Java |
Usage
Sources:
- Official upstream README
- Official extension control file (vastbase_sm4.control)
- Official extension SQL (vastbase_sm4–1.0.sql)
vastbase_sm4 — SM4 encryption/decryption functions for VastBase using Java implementation via JNI. Use it when implementing the corresponding security, audit, or access-control workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
sm4_decrypt(cipher_text text, hex_key text)is an extension function and returnstext.sm4_decrypt_base64(cipher_text text, base64_key text)is an extension function and returnstext.sm4_encrypt(plain_text text, hex_key text)is an extension function and returnstext.sm4_encrypt_base64(plain_text text, base64_key text)is an extension function and returnstext.sm4_generate_key()is an extension function and returnstext.sm4_extension_infois an extension-defined view.
Requirements and Caveats
- The reviewed control file declares default version
1.0. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.