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