1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public static String importer_certificat(String alias,String nom_certi,String nom_keystore,String pass_keystore)
{
try{
String b = "keytool -import -alias "+alias+" -file "+nom_certi+" -keystore "+nom_keystore +" -storepass "+pass_keystore;
System.out.println(b);
Process p = Runtime.getRuntime().exec(b);
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String inputLine, tous = "";
while ((inputLine = in.readLine()) != null)
{
tous += "\n"+inputLine;
System.out.println(inputLine);
}
return tous;
}catch(Exception e)
{
e.printStackTrace();
return e.getMessage();
}
} |
Partager