i2ptunnel:

ECDSA default for all new server tunnels
ECDSA default for streamr client tunnels
Fix display of server destination on edit page when not running (privkey file path wasn't absolute)
Fix display of persistent client key b32 on edit page when not running
Fix display of server sig type on edit page when we have a privkey file
Add KeysAndCert.getSigType()
Javadocs
This commit is contained in:
zzz
2014-11-02 15:23:13 +00:00
parent 2284c963af
commit 6ca0c54ba7
5 changed files with 168 additions and 49 deletions

View File

@ -16,6 +16,7 @@ import java.io.OutputStream;
import java.util.Arrays;
import net.i2p.crypto.SHA256Generator;
import net.i2p.crypto.SigType;
/**
* KeysAndCert has a public key, a signing key, and a certificate.
@ -51,6 +52,22 @@ public class KeysAndCert extends DataStructureImpl {
_certificate = cert;
}
/**
* @return null if not set or unknown
* @since 0.9.17
*/
public SigType getSigType() {
if (_certificate == null)
return null;
if (_certificate.getCertificateType() == Certificate.CERTIFICATE_TYPE_KEY) {
try {
KeyCertificate kcert = _certificate.toKeyCertificate();
return kcert.getSigType();
} catch (DataFormatException dfe) {}
}
return SigType.DSA_SHA1;
}
public PublicKey getPublicKey() {
return _publicKey;
}