Skip to main content
These module-level functions persist a per-index KMS envelope describing how the index KEK is wrapped by an external Key Management Service. The envelope is stored as a FlatBuffer next to the index keystore.
KMS key wrapping is primarily for the service layer. Embedded SDK users who supply their own KEK directly can ignore these functions, or use provider = "none". They are advanced and optional.

Concepts

  • KMS envelope. A KMSBlob records how an index’s KEK is wrapped by an external KMS. Callers never store the plaintext KEK in the envelope; they store the wrapped form plus the metadata needed to unwrap it.
  • Providers.
    • "aws" — the KEK is wrapped with AES-256-GCM under a value stored in AWS Secrets Manager.
    • "aws-kms" — the KEK is wrapped via kms.Encrypt.
    • "none" — nothing is stored; the SDK supplies the plaintext KEK per request.
  • Strict insert vs. upsert. CreateIndexKMS fails if an envelope already exists for the index; PushIndexKMS is an idempotent upsert.

CreateIndexKMS

Stores a new KMS envelope for the index. Strict insert — throws if one already exists.

Parameters


PushIndexKMS

Idempotent upsert of the KMS envelope for the index. Creates it if absent, overwrites it otherwise.

Parameters


GetIndexKMS

Retrieves the stored KMS envelope for the index.

Parameters

Returns

KMSBlob: The stored KMS envelope.

DeleteIndexKMS

Deletes the stored KMS envelope for the index. Idempotent.

Parameters


KMSBlob

The KMS envelope struct (see KMSBlob):

Example Usage