Table of Contents

Enum EncryptionMode

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

Defines the encryption mode for field-level encryption operations during migration phases.

public enum EncryptionMode

Fields

DecryptOnlyReadOnly = 3

Read-only migration mode: decrypt for reads, reject writes.

Use this mode for read-only systems during migration verification or when the system should not modify encrypted data.

Write operations in this mode will throw InvalidOperationException.

DecryptOnlyWritePlaintext = 2

Migration phase 2: decrypt all reads, write back as plaintext.

Use this mode when migrating away from encryption entirely. Reads decrypt encrypted data, but writes store data in plaintext. This allows gradual migration to unencrypted storage.

Warning: This mode reduces security. Use only during planned migration with appropriate access controls in place.

Disabled = 4

Encryption disabled: pass through all data without transformation.

Use this mode after migration is complete or for systems that do not require encryption. Data is read and written without any encryption or decryption.

Note: Existing encrypted data will NOT be automatically decrypted. Use DecryptOnlyWritePlaintext first to migrate encrypted data.

EncryptAndDecrypt = 0

Normal operation: encrypt all writes, decrypt all reads.

This is the default mode for steady-state operation with field-level encryption enabled.

EncryptNewDecryptAll = 1

Migration phase 1: encrypt new data with new provider, decrypt from any registered provider.

Use this mode when rotating to a new encryption key or provider. New data is encrypted with the primary provider, while reads can decrypt data encrypted by any legacy provider.

This mode requires IEncryptionProviderRegistry to have legacy providers registered.

Remarks

These modes support a phased migration strategy from one encryption provider to another, or from encrypted to unencrypted data.

The migration path typically follows: EncryptAndDecrypt → EncryptNewDecryptAll → DecryptOnlyWritePlaintext → Disabled.