Interface Cipher

All Known Implementing Classes:
AesGcmCipher

public interface Cipher
The field-level protection primitive that the caller provides — a seam onto a KMS, a Vault transit engine, an HSM, a tokenisation service, or the reference AesGcmCipher below. protect runs encrypt(byte[]) over every x-gdpr-sensitive leaf's value (after it is canonically JSON-encoded); unprotect runs decrypt(java.lang.String) to restore it. Keeping this an interface is what holds GR-7: the core never pulls a crypto/KMS dependency — only a caller who binds a concrete backend does.

Contract for an implementation:

  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    decrypt(String ciphertext)
    Reverses encrypt(byte[]), returning the original field-value JSON bytes.
    encrypt(byte[] plaintext)
    Protects one field value (its canonical JSON bytes) and returns a JSON-safe ciphertext string.