public static String credentialToString(ScramCredential credential) {
        return String.format("%s=%s,%s=%s,%s=%s,%s=%d",
               SALT,
               Base64.getEncoder().encodeToString(credential.salt()),
               STORED_KEY,
               Base64.getEncoder().encodeToString(credential.storedKey()),
               SERVER_KEY,
               Base64.getEncoder().encodeToString(credential.serverKey()),
               ITERATIONS,
               credential.iterations());
    }
SCRAM Credential persistence utility functions. Implements format conversion used
for the credential store implemented in Kafka. Credentials are persisted as a comma-separated
String of key-value pairs:
<pre>
  salt=<i>salt</i>,stored_key=<i>stored_key</i>,server_key=<i>server_key</i>,iterations=<i>iterations</i>
</pre>
clients/src/main/java/org/apache/kafka/common/security/scram/internals/ScramCredentialUtils.java