Interface IPIIManager
- Namespace
- Cratis.Chronicle.Compliance.GDPR
- Assembly
- Cratis.Chronicle.dll
Defines a manager of PII in the system.
public interface IPIIManager
- Extension Methods
Methods
AllowNewEncryptionKeyFor(EncryptionKeyIdentifier)
Authorize a new encryption key for a subject that was erased, so a later lawful lifecycle can protect their data again.
Task AllowNewEncryptionKeyFor(EncryptionKeyIdentifier identifier)
Parameters
identifierEncryptionKeyIdentifierEncryptionKeyIdentifier to authorize a new key for.
Returns
- Task
Awaitable task.
Remarks
Erasing a subject removes the key that exists now; it does not ban the identifier forever. This creates no key - it lets the next PII value written for the subject provision a fresh, independent one, which can decrypt nothing written before the erasure. The erased key itself never comes back, whatever else happens.
The default implementation exists so that adding this member did not break implementations written before it - realistically test doubles, which never call it and keep compiling. It throws rather than doing nothing, because an authorization that silently did not happen reads as a subject who can be protected again right up until the append that proves they cannot.
Exceptions
- AllowNewEncryptionKeyNotSupported
Thrown by an implementation that does not override this member.
DeleteEncryptionKeyFor(EncryptionKeyIdentifier)
Erase the encryption key for a subject, making every PII value protected under it permanently unreadable.
Task DeleteEncryptionKeyFor(EncryptionKeyIdentifier identifier)
Parameters
identifierEncryptionKeyIdentifierEncryptionKeyIdentifier to erase.
Returns
- Task
Awaitable task.
Remarks
The erasure covers every event store in this manager's namespace, not only the event store it was resolved from. Chronicle copies a subject's key into any event store it forwards their events into, so that set is exactly where the key can have reached; erasing less than all of it leaves a copy that is put back the next time an event is forwarded. It also records the erasure, so nothing provisions or copies a key for the subject afterwards - appending a PII value for them fails rather than silently minting a new key, until AllowNewEncryptionKeyFor(EncryptionKeyIdentifier) authorizes one.