/** * Encrypt the gateway and tunnel ID of each lease, leaving the expire dates unchanged. * This adds an extra dummy lease, because AES data must be padded to 16 bytes. * The fact that it is encrypted is not stored anywhere. * Must be called after all the leases are in place, but before sign(). */ public void encrypt(SessionKey key) { //if (_log.shouldLog(Log.WARN)) // _log.warn("encrypting lease: " + _destination.calculateHash()); try { encryp(key); } catch (DataFormatException dfe) { Log log = I2PAppContext.getGlobalContext().logManager().getLog(LeaseSet.class); log.error("Error encrypting lease: " + _destination.calculateHash(), dfe); } catch (IOException ioe) { Log log = I2PAppContext.getGlobalContext().logManager().getLog(LeaseSet.class); log.error("Error encrypting lease: " + _destination.calculateHash(), ioe); } }