* Key cert GUI support:

- Add setting in i2ptunnel server edit page
  - Comment out cert setting on i2ptunnel server edit page
  - Show key type on susidns details page
  - Show key type on LS debug page
This commit is contained in:
zzz
2014-01-03 15:31:08 +00:00
parent e8e239616f
commit 41e071efe5
6 changed files with 82 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import net.i2p.client.I2PClient;
import net.i2p.data.Base64;
import net.i2p.data.Destination;
import net.i2p.data.PrivateKeyFile;
@ -177,6 +178,11 @@ public class EditBean extends IndexBean {
return getBooleanProperty(tunnel, "i2cp.encryptLeaseSet");
}
/** @since 0.9.11 */
public int getSigType(int tunnel) {
return getProperty(tunnel, I2PClient.PROP_SIGTYPE, 0);
}
/** @since 0.8.9 */
public boolean getDCC(int tunnel) {
return getBooleanProperty(tunnel, I2PTunnelIRCClient.PROP_DCC);

View File

@ -22,6 +22,7 @@ import java.util.StringTokenizer;
import java.util.concurrent.ConcurrentHashMap;
import net.i2p.I2PAppContext;
import net.i2p.client.I2PClient;
import net.i2p.data.Base32;
import net.i2p.data.Certificate;
import net.i2p.data.Destination;
@ -950,6 +951,7 @@ public class IndexBean {
} catch (NumberFormatException nfe) {}
}
}
public void setCert(String val) {
if (val != null) {
try {
@ -957,10 +959,24 @@ public class IndexBean {
} catch (NumberFormatException nfe) {}
}
}
public void setSigner(String val) {
_certSigner = val;
}
/** @since 0.9.11 */
public void setSigType(String val) {
if (val != null) {
_otherOptions.put(I2PClient.PROP_SIGTYPE, val);
if (val.equals("0"))
_certType = 0;
else
_certType = 5;
}
// TODO: Call modifyDestination??
// Otherwise this only works on a new tunnel...
}
/** Modify or create a destination */
private String modifyDestination() {
if (_privKeyFile == null || _privKeyFile.trim().length() <= 0)
@ -1205,7 +1221,7 @@ public class IndexBean {
"i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.leaseSetKey", "i2cp.accessList",
PROP_MAX_CONNS_MIN, PROP_MAX_CONNS_HOUR, PROP_MAX_CONNS_DAY,
PROP_MAX_TOTAL_CONNS_MIN, PROP_MAX_TOTAL_CONNS_HOUR, PROP_MAX_TOTAL_CONNS_DAY,
PROP_MAX_STREAMS
PROP_MAX_STREAMS, I2PClient.PROP_SIGTYPE
};
private static final String _httpServerOpts[] = {
I2PTunnelHTTPServer.OPT_POST_WINDOW,