forked from I2P_Developers/i2p.i2p
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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user