validateNameAttribute

fun validateNameAttribute(normalizedNameAttribute: String, validation: LegalNameValidator.Validation)

The validation function validates a string for use as part of a legal name. It applies the following rules:

  • Does not contain the null character

  • Must be normalized (as per the normalize function).

  • Length must be 255 characters or shorter.

Full validation (typically this is only done for names the Doorman approves) adds:

  • Restrict names to Latin scripts for now to avoid right-to-left issues, debugging issues when we can't pronounce names over the phone, and character confusability attacks.

  • No commas or equals signs.

  • No dollars or quote marks, we might need to relax the quote mark constraint in future to handle Irish company names.

Throws

if the name does not meet the required rules. The message indicates why not.