Changeset 7474335


Ignore:
Timestamp:
Mar 16, 2012 12:09:49 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f2a3d59
Parents:
1de88909
Message:

in advanced config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/TrustedUpdate.java

    r1de88909 r7474335  
    161161    private static final int KEYSIZE_B64_BYTES = 2 + (SigningPublicKey.KEYSIZE_BYTES * 4 / 3);
    162162
     163    private static final Map<String, String> DEFAULT_KEYS = new HashMap(4);
     164    static {
     165            //DEFAULT_KEYS.put(DEFAULT_TRUSTED_KEY, "jrandom@mail.i2p");
     166            DEFAULT_KEYS.put(DEFAULT_TRUSTED_KEY2, "zzz@mail.i2p");
     167            //DEFAULT_KEYS.put(DEFAULT_TRUSTED_KEY3, "complication@mail.i2p");
     168            DEFAULT_KEYS.put(DEFAULT_TRUSTED_KEY4, "HungryHobo@mail.i2p");
     169            DEFAULT_KEYS.put(DEFAULT_TRUSTED_KEY5, "killyourtv@mail.i2p");
     170    }
     171
    163172    /**
    164173     * Constructs a new <code>TrustedUpdate</code> with the default global
     
    185194            StringTokenizer propertyTrustedKeysTokens = new StringTokenizer(propertyTrustedKeys, " ,\r\n");
    186195
    187             while (propertyTrustedKeysTokens.hasMoreTokens())
    188                 addKey(propertyTrustedKeysTokens.nextToken().trim(), "");
    189 
     196            while (propertyTrustedKeysTokens.hasMoreTokens()) {
     197                // If a key from the defaults, use the same name
     198                String key = propertyTrustedKeysTokens.nextToken().trim();
     199                String name = DEFAULT_KEYS.get(key);
     200                if (name == null)
     201                    name = "";
     202                addKey(key, name);
     203            }
    190204        } else {
    191             //addKey(DEFAULT_TRUSTED_KEY, "jrandom@mail.i2p");
    192             addKey(DEFAULT_TRUSTED_KEY2, "zzz@mail.i2p");
    193             //addKey(DEFAULT_TRUSTED_KEY3, "complication@mail.i2p");
    194             addKey(DEFAULT_TRUSTED_KEY4, "HungryHobo@mail.i2p");
    195             addKey(DEFAULT_TRUSTED_KEY5, "killyourtv@mail.i2p");
     205            for (Map.Entry<String, String> e : DEFAULT_KEYS.entrySet()) {
     206                addKey(e.getKey(), e.getValue());
     207            }
    196208        }
    197209        if (_log.shouldLog(Log.DEBUG))
     
    208220     */
    209221    public boolean addKey(String key, String name) {
     222        if (_log.shouldLog(Log.DEBUG))
     223            _log.debug("Adding " + name + ": " + key);
    210224        SigningPublicKey signingPublicKey = new SigningPublicKey();
    211225        try {
Note: See TracChangeset for help on using the changeset viewer.