Skip to content

createAes256GcmSensitiveValueProtector — @gj-kit/toss-payments-postgresql

A public function from @gj-kit/toss-payments-postgresql. The signature below is taken directly from the 0.5.1 release declaration.

import { createAes256GcmSensitiveValueProtector } from '@gj-kit/toss-payments-postgresql';
/**
* Builds a `SensitiveValueProtector` that seals values with AES-256-GCM, a fresh random
* 12-byte IV per `encrypt`, and the seam context bound as AAD.
*
* The host keeps key custody and rotation: this function never generates, persists, or
* rotates keys. Because the IV is random, NIST SP 800-38D §8.3 caps a single key at 2^32
* `encrypt` invocations — rotate to a new `keyId` well before that; the library does not
* count. Key/config misuse throws `TypeError` synchronously at construction; `encrypt`
* rejects with `TypeError` for non-string or ill-formed UTF-16 plaintext (lone surrogates
* would otherwise be silently replaced with U+FFFD and fail to round-trip); undecryptable
* rows reject with `SensitiveValueProtectorError` (`code` is the contract).
*/
declare function createAes256GcmSensitiveValueProtector(options: Aes256GcmSensitiveValueProtectorOptions): SensitiveValueProtector;

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/toss-payments-postgresql
  • Version: 0.5.1
  • Public entry: .
  • Source: GitHub