forked from I2P_Developers/i2p.i2p
log tweaks
This commit is contained in:
@ -326,7 +326,10 @@ public class KeyStoreUtil {
|
||||
if (success) {
|
||||
try {
|
||||
success = getPrivateKey(ks, ksPW, alias, keyPW) != null;
|
||||
if (!success)
|
||||
error("Key gen failed to get private key", null);
|
||||
} catch (Exception e) {
|
||||
error("Key gen failed to get private key", e);
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
@ -458,6 +461,11 @@ public class KeyStoreUtil {
|
||||
}
|
||||
|
||||
private static void log(I2PAppContext ctx, int level, String msg, Throwable t) {
|
||||
if (level >= Log.WARN && !ctx.isRouterContext()) {
|
||||
System.out.println(msg);
|
||||
if (t != null)
|
||||
t.printStackTrace();
|
||||
}
|
||||
Log l = ctx.logManager().getLog(KeyStoreUtil.class);
|
||||
l.log(level, msg, t);
|
||||
}
|
||||
|
@ -695,13 +695,13 @@ public class SU3File {
|
||||
alias, "I2P", 3652, type.getBaseAlgorithm().getName(),
|
||||
keylen, keypw);
|
||||
if (!success) {
|
||||
System.err.println("Error writing keys:");
|
||||
System.err.println("Error creating keys for " + alias);
|
||||
return false;
|
||||
}
|
||||
File outfile = new File(publicKeyFile);
|
||||
success = KeyStoreUtil.exportCert(ksFile, KeyStoreUtil.DEFAULT_KEYSTORE_PASSWORD, alias, outfile);
|
||||
if (!success) {
|
||||
System.err.println("Error writing keys:");
|
||||
System.err.println("Error writing public key for " + alias + " to " + outfile);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user