isValid

abstract val isValid: Boolean?(source)

Returns whether this string's rawValue is valid for its concrete ASN.1 string type:

UTF8, BMP, and Universal validate their wire encodings directly; repertoire-based types validate the decoded value.

Accuracy caveat: Teletex always reports null; its Latin-1 compatibility encoding does not validate T.61. General and Graphic perform best-effort recognition of their multi-byte / ISO 2022 repertoires: true for a recognized subset, null for anything else, and never false — so they never reject potentially-valid input. UTF8, IA5, Visible, Printable, and Numeric validate their exact repertoires and do report false for violations.