Here you can find the source of loadPrivateKeyFile(File privateKeyFile)
private static String loadPrivateKeyFile(File privateKeyFile) throws IOException
//package com.java2s; // License as published by the Free Software Foundation; either import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main { /** Reads in the private key verbatim from the private key file */ private static String loadPrivateKeyFile(File privateKeyFile) throws IOException { BufferedReader in = new BufferedReader(new FileReader(privateKeyFile)); StringBuffer key_buf = new StringBuffer(); String line;//w ww. ja v a 2 s . c o m while ((line = in.readLine()) != null) { key_buf.append(line); key_buf.append('\n'); } in.close(); return key_buf.toString().trim(); } }