maskingContextElement

A coroutine context element that installs principal's MaskingContext on whichever thread runs the (synchronous) encode — the bridge for coroutine callers such as Ktor (#82):

withContext(maskingContextElement(principal)) { json.encodeToString(serializer, value) }