Exemple #1
0
 public void allowOnlyTheseAuthorizedKeysToRead(HQKeys authorizedKeys) {
   HQKeys keys = getAuthorizedToReadKeys();
   for (int i = 0; i < keys.size(); ++i) {
     HQKey oldKey = keys.get(i);
     if (!authorizedKeys.containsKey(oldKey.getPublicKey())) keys.remove(i);
   }
   setAuthorizedToReadKeys(keys);
 }
Exemple #2
0
 public void addAuthorizedToReadKeys(HQKeys keysToAdd) {
   HQKeys keys = getAuthorizedToReadKeys();
   for (int i = 0; i < keysToAdd.size(); ++i) {
     HQKey keyToAdd = keysToAdd.get(i);
     if (!keys.containsKey(keyToAdd.getPublicKey())) {
       keys.add(keyToAdd);
     }
   }
   setAuthorizedToReadKeys(keys);
 }