Skip to content

maskValue

string maskValue(value, valueType)
string maskValue(value, valueType, maskStyle)

Apply the currently configured data masking context to mask value as a value of type valueType. How the value is masked may be influenced by maskStyle, although a value that requires masking will be masked even if the value of maskStyle is unknown.

A value will be masked when:

  • The value of valueType is known and selected in the current context; or
  • The value of valueType is not known and a value type named "*" is known and selected in the current context.

A value will not be masked when:

  • The value of valueType is known and not selected in the current context; or
  • Neither the value of valueType nor a value type named "*" are known in the current context.

Managing selected value types is handled by manipulating the valuetype-set custom profile property. Valid values for this property are defined by the profile and beyond the scope of this document.

ParameterRequired?Description
valueYThe content to be masked. The entire buffer is assumed to be eligible for masking.
valueTypeYThe user- and/or masking profile-defined concept the context represents, such as a password. The value is not required to be known in the current masking context.
maskStyleNThe masking profile-defined masking behavior. Where the default behavior may mask every character of value, alternative behaviors may only mask a subset of characters. The default behavior is applied when omitted, empty, or unrecognized.

Released under the Apache-2.0 License.