private void generateKeyStoreJksFile() throws IOException {
    try (final FileOutputStream keyStoreOutputStream = new FileOutputStream(keyStoreJksFile)) {
      byte[] bytes = X509TestHelpers.certAndPrivateKeyToJavaKeyStoreBytes(keyStoreCertificate,
        keyStoreKeyPair.getPrivate(), keyStorePassword);
      keyStoreOutputStream.write(bytes);
      keyStoreOutputStream.flush();
    } catch (GeneralSecurityException e) {
      throw new IOException(e);
    }
  }
Returns the path to the key store file in the given format (JKS, PEM, ...). Note that the file
is created lazily, the first time this method is called. The key store file is temporary and
will be deleted on exit.
@param storeFileType the store file type (JKS, PEM, ...).
@return the path to the key store file.
@throws IOException if there is an error creating the key store file.
hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/X509TestContext.java