Skip to main content

EXCMP004: Erasable personal data encrypted under a surviving purpose

PropertyValue
Diagnostic IDEXCMP004
TitleA property is both erasable personal data and encrypted under a surviving purpose
CategoryExcalibur.Compliance.Encryption
SeverityWarning
Enabled by defaultYes
Code-fixNo

Cause​

A property carries [PersonalData] and also [EncryptedField] with an explicit Purpose. The two make opposite promises:

  • [PersonalData] binds the value to a per-subject key that is destroyed when the subject is erased.
  • An explicit Purpose binds it to a key chosen to survive erasure.

Honouring either one silently would make the other false, so the framework refuses both.

Example​

public sealed class Patient
{
[PersonalData]
[EncryptedField(Purpose = "billing")] // EXCMP004
public string Name { get; set; } = "";
}

How to Fix​

Decide which promise the value needs:

// Erasable with the subject: drop the Purpose.
[PersonalData]
[EncryptedField]
public string Name { get; set; } = "";

// Must outlive the subject: drop [PersonalData].
[EncryptedField(Purpose = "billing")]
public string BillingReference { get; set; } = "";

When to Suppress​

Do not suppress. The framework refuses this combination at run time.

See Also​