Changeset 3cd12ec for core/java


Ignore:
Timestamp:
Jan 27, 2019 3:59:34 PM (18 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3fca0f6
Parents:
0889a75
Message:

LS2: Select first supported encryption key from leaseset
OCMOSJ: Fail if unsupported crypto or bad ls type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/LeaseSet2.java

    r0889a75 r3cd12ec  
    6565            return null;
    6666        return _options.getProperty(opt);
     67    }
     68
     69    /**
     70     *  If more than one key, return the first supported one.
     71     *  If none supported, return the first one.
     72     *
     73     *  @since 0.9.39 overridden
     74     */
     75    @Override
     76    public PublicKey getEncryptionKey() {
     77        if (_encryptionKeys != null) {
     78            for (PublicKey pk : _encryptionKeys) {
     79                EncType type = pk.getType();
     80                if (type != null && type.isAvailable())
     81                    return pk;
     82            }
     83        }
     84        return _encryptionKey;
    6785    }
    6886
Note: See TracChangeset for help on using the changeset viewer.