forked from I2P_Developers/i2p.i2p
LS2: Select first supported encryption key from leaseset
OCMOSJ: Fail if unsupported crypto or bad ls type
This commit is contained in:
@ -66,6 +66,24 @@ public class LeaseSet2 extends LeaseSet {
|
||||
return _options.getProperty(opt);
|
||||
}
|
||||
|
||||
/**
|
||||
* If more than one key, return the first supported one.
|
||||
* If none supported, return the first one.
|
||||
*
|
||||
* @since 0.9.39 overridden
|
||||
*/
|
||||
@Override
|
||||
public PublicKey getEncryptionKey() {
|
||||
if (_encryptionKeys != null) {
|
||||
for (PublicKey pk : _encryptionKeys) {
|
||||
EncType type = pk.getType();
|
||||
if (type != null && type.isAvailable())
|
||||
return pk;
|
||||
}
|
||||
}
|
||||
return _encryptionKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an encryption key.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user