Package craterdog.smart
Annotation Interface Sensitive
This annotation is used to mark string attributes that contain sensitive information and should
be masked when output to a log file, and encrypted when stored in a database.
- Author:
- Yan Ma
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptioncharThe character that should be used to mask the value of the annotated attribute. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMask for a credit card number: dddd-XXXX-XXXX-ddddstatic final StringMask for a email address.static final StringMask for a password or alphanumeric pin with various lengths (min length = 4, max length = 100): mask all charactersstatic final StringMask for a phone number: XXX-XXX-dddd leave the last four digits unmaskedstatic final StringMASK for a SSN: XXX-XX-dddd leave the last four digits unmasked
-
Field Details
-
MASK_PASSWORD
Mask for a password or alphanumeric pin with various lengths (min length = 4, max length = 100): mask all characters- See Also:
-
MASK_EMAIL_ADDRESS
Mask for a email address. Masks every character before @- See Also:
-
MASK_PHONE_NUMBER
Mask for a phone number: XXX-XXX-dddd leave the last four digits unmasked- See Also:
-
MASK_CREDIT_CARD_NUMBER
Mask for a credit card number: dddd-XXXX-XXXX-dddd- See Also:
-
MASK_SSN
MASK for a SSN: XXX-XX-dddd leave the last four digits unmasked- See Also:
-
-
Element Details
-
type
String typeThe type of sensitive attribute. This may be needed to determine how to encrypt/decrypt the sensitive information.- Returns:
- The attribute type
-
mask
String maskThe masking pattern that should be applied to the value of the annotated attribute. The pattern is a regular expression that contains "(" and ")" surrounding the parts of the string that should be masked with "X"s.- Returns:
- The masking pattern.
-
-
-
character
char characterThe character that should be used to mask the value of the annotated attribute. The default character is 'X'.- Returns:
- The masking character.
- Default:
- 'X'
-