HostTxtEntry: Fixups for use by i2ptunnel

i2ptunnel: Add new registration authentication page
- Remove old, unused hostname signature generation
PrivateKeyFile: Ensure initialization before returning private keys
This commit is contained in:
zzz
2016-04-24 18:10:10 +00:00
parent 799d90e1b5
commit 2a34d1c44a
6 changed files with 271 additions and 9 deletions

View File

@ -71,6 +71,7 @@ public class EditBean extends IndexBean {
return _helper.getPrivateKeyFile(tunnel);
}
/****
public String getNameSignature(int tunnel) {
String spoof = getSpoofedHost(tunnel);
if (spoof.length() <= 0)
@ -100,6 +101,26 @@ public class EditBean extends IndexBean {
}
return "";
}
****/
/**
* @since 0.9.26
* @return key or null
*/
public SigningPrivateKey getSigningPrivateKey(int tunnel) {
TunnelController tun = getController(tunnel);
if (tun == null)
return null;
String keyFile = tun.getPrivKeyFile();
if (keyFile != null && keyFile.trim().length() > 0) {
File f = new File(keyFile);
if (!f.isAbsolute())
f = new File(_context.getConfigDir(), keyFile);
PrivateKeyFile pkf = new PrivateKeyFile(f);
return pkf.getSigningPrivKey();
}
return null;
}
public boolean startAutomatically(int tunnel) {
return _helper.shouldStartAutomatically(tunnel);