Table of Contents

Class PiiMasker

Namespace
SEBT.Portal.Core.Utilities
Assembly
SEBT.Portal.Core.dll

Utility class for partially masking PII fields (email, phone, address) so users can recognize their data without exposing full details.

public static class PiiMasker
Inheritance
object
PiiMasker

Methods

MaskEmail(string?)

Masks an email address, preserving the first character of the local part and the full domain. Example: "jane@example.com" → "j***@example.com"

public static string? MaskEmail(string? email)

Parameters

email string

The email address to mask.

Returns

string

The masked email, or null if the input is null or whitespace.

MaskPhone(string?)

Masks a phone number, preserving only the last 4 digits. Example: "(303) 555-0100" → "--0100"

public static string? MaskPhone(string? phone)

Parameters

phone string

The phone number to mask.

Returns

string

The masked phone, or null if the input is null or whitespace.

MaskStreetAddress(string?, string?)

Masks street address lines by returning a generic masked indicator. Callers should handle city, state, and ZIP code values separately if needed.

public static string? MaskStreetAddress(string? streetAddress1, string? streetAddress2)

Parameters

streetAddress1 string

The primary street address line.

streetAddress2 string

The secondary street address line (apt, suite, etc.).

Returns

string

A masked street indicator, or null if both street address lines are null or whitespace. Callers should log a warning when this returns null — a missing address likely indicates an upstream data issue that warrants investigation.