public static java.lang.String fixString(java.lang.String str)
Takes the given string and tries to fix any errors like null characters. If it encounters a
null character, it truncates the string at this position. Other non-printable characters are
changed to single whitespaces. This method is used to correct strings from PKCS#11 modules
which are often non-compliant to the PKCS#11 specification.