Here you can find the source of saveKeyToFile(String key)
public static void saveKeyToFile(String key)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.StringReader; public class Main { public static void saveKeyToFile(String key) { try {//from w w w .j a v a2s . com FileOutputStream out = new FileOutputStream( "/home/junior/antinsa.keystore"); BufferedReader c = new BufferedReader(new StringReader(key)); int b; while ((b = c.read()) > -1) { out.write(b); } c.close(); out.close(); } catch (FileNotFoundException ex) { } catch (IOException ex) { } } }