mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 00:02:59 +00:00
LS2: Select first supported encryption key from leaseset
OCMOSJ: Fail if unsupported crypto or bad ls type
This commit is contained in:
1 parent
0889a751db
commit
3cd12ecefc
2 files changed
+35
-3
No files matched your search
@@ -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