@Override public void updateKey() throws GeneralSecurityException, PasswordException, IOException { save(); }
/** * Deletes an email identity. * @param key A base64-encoded email identity key * @return null if sucessful, or an error message if an error occured * @throws PasswordException * @throws GeneralSecurityException * @throws IOException */ public static String deleteIdentity(String key) throws PasswordException, IOException, GeneralSecurityException { Identities identities = I2PBote.getInstance().getIdentities(); identities.remove(key); try { identities.save(); return null; } catch (PasswordException e) { throw e; } catch (Exception e) { return e.getLocalizedMessage(); } }
for (EmailIdentity identity: identitiesSet) identities.add(identity); identities.save();
/** Publishes an email destination in the address directory. */ public void publishDestination(String destination, byte[] picture, String text) throws PasswordException, IOException, GeneralSecurityException, DhtException, InterruptedException { EmailIdentity identity = identities.get(destination); if (identity != null) { identity.setPicture(picture); identity.setText(text); if (identity.getFingerprint() == null) identity.generateFingerprint(); // if no fingerprint exists, generate one and save it in the next step identities.save(); Contact entry = new Contact(identity, identities, picture, text, identity.getFingerprint()); dht.store(entry); } }