Documentation
¶
Index ¶
Constants ¶
const Redacted = EncryptedValue("[REDACTED]")
Redacted is a constant for displaying redacted PII in logs/debug output.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
Adapter bridges generic envelope encryption to PII-specific interfaces. It hardcodes key version to 1 (PII keys don't rotate).
func NewAdapter ¶
NewAdapter creates a new PII adapter for the given scope.
type Decryptor ¶
type Decryptor[ID fmt.Stringer] interface { Decrypt(ctx context.Context, subjectID ID, value EncryptedValue) (string, error) }
Decryptor decrypts encrypted PII for a specific subject.
type EncryptedValue ¶
type EncryptedValue string
EncryptedValue represents an encrypted piece of PII. It is an opaque base64-encoded string. Key version is always 1 (no rotation). When the encryption key is destroyed (crypto-shredding), this value becomes permanently unreadable.
func (EncryptedValue) IsEmpty ¶
func (e EncryptedValue) IsEmpty() bool
IsEmpty returns true if the encrypted value is an empty string.
func (EncryptedValue) String ¶
func (e EncryptedValue) String() string
String returns the underlying string value.