[FIXED JENKINS-21668] Obtain root CA information for java instances

This will only work if there is no password for obtaining the keystore.
Uh, just use a `StringWriter` and save yourself the encoding hassles.