ObjectStackObjectStack

Encryption

Encryption protocol schemas

Field-level encryption protocol

GDPR/HIPAA/PCI-DSS compliant

Source: packages/spec/src/system/encryption.zod.ts

TypeScript Usage

import { EncryptionAlgorithm, EncryptionConfig, FieldEncryption, KeyManagementProvider, KeyRotationPolicy } from '@objectstack/spec/system';
import type { EncryptionAlgorithm, EncryptionConfig, FieldEncryption, KeyManagementProvider, KeyRotationPolicy } from '@objectstack/spec/system';

// Validate data
const result = EncryptionAlgorithm.parse(data);

EncryptionAlgorithm

Supported encryption algorithm

Allowed Values

  • aes-256-gcm
  • aes-256-cbc
  • chacha20-poly1305

EncryptionConfig

Field-level encryption configuration

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable field-level encryption
algorithmEnum<'aes-256-gcm' | 'aes-256-cbc' | 'chacha20-poly1305'>Encryption algorithm
keyManagementObjectKey management configuration
scopeEnum<'field' | 'record' | 'table' | 'database'>Encryption scope level
deterministicEncryptionbooleanAllows equality queries on encrypted data
searchableEncryptionbooleanAllows search on encrypted data

FieldEncryption

Per-field encryption assignment

Properties

PropertyTypeRequiredDescription
fieldNamestringName of the field to encrypt
encryptionConfigObjectEncryption settings for this field
indexablebooleanAllow indexing on encrypted field

KeyManagementProvider

Key management service provider

Allowed Values

  • local
  • aws-kms
  • azure-key-vault
  • gcp-kms
  • hashicorp-vault

KeyRotationPolicy

Policy for automatic encryption key rotation

Properties

PropertyTypeRequiredDescription
enabledbooleanEnable automatic key rotation
frequencyDaysnumberRotation frequency in days
retainOldVersionsnumberNumber of old key versions to retain
autoRotatebooleanAutomatically rotate without manual approval

On this page