code: public static void createFile(SshKeyPair key, String passphrase,
  			String comment, int format, File toFile) throws IOException {
  
  		SshPrivateKeyFile pub = create(key, passphrase, comment, format);
  
  		FileOutputStream out = new FileOutputStream(toFile);
  
  		try {
  			out.write(pub.getFormattedKey());
  			out.flush();
  		} finally {
  			out.close();
  		}
  	}
docs: Take a <a href="SshPrivateKey.html">SshPrivateKey</a> and write it to a
  file.
  
  @param key
  @param comment
  @param format
  @param toFile
  @throws IOException