/** @throws I2PException always */ @Override public void connect(SAMv3Handler handler, String dest, Properties props) throws I2PException { throw new I2PException("master session"); }
/** @since 0.9.21 */ private void verifySession(I2PSession session) throws I2PException { if (_isDestroyed.get()) throw new I2PException("Session was closed"); if (!session.isClosed()) return; session.connect(); }
/** * Verify the signature if necessary. * * @throws I2PException if the signature was necessary and it was invalid */ private void verifySignature(Packet packet, Connection con) throws I2PException { // verify the signature if necessary if (con.getOptions().getRequireFullySigned() || packet.isFlagSet(Packet.FLAG_SYNCHRONIZE | Packet.FLAG_CLOSE)) { // we need a valid signature Destination from = con.getRemotePeer(); if (from == null) from = packet.getOptionalFrom(); boolean sigOk = packet.verifySignature(_context, from, null); if (!sigOk) { throw new I2PException("Received unsigned / forged packet: " + packet); } } }
opts.setLocalPort(Integer.parseInt(fromPort)); } catch (NumberFormatException nfe) { throw new I2PException("Bad port " + fromPort); opts.setPort(Integer.parseInt(toPort)); } catch (NumberFormatException nfe) { throw new I2PException("Bad port " + toPort);
tstype = SigType.parseSigType(ttype); if (tstype == null) throw new I2PException("Bad or unsupported -r option: " + ttype); Signature sign = DSAEngine.getInstance().sign(data, pkf.getSigningPrivKey()); if (sign == null) throw new I2PException("Sig fail");
I2PServerSocket ci2pss = i2pss; if (ci2pss == null) throw new I2PException("I2PServerSocket closed");
signingKeys = KeyGenerator.getInstance().generateSigningKeys(type); } catch (GeneralSecurityException gse) { throw new I2PException("keygen fail", gse);
/** @since 0.9.21 */ private void verifySession(I2PSession session) throws I2PException { if (_isDestroyed.get()) throw new I2PException("Session was closed"); if (!session.isClosed()) return; session.connect(); }
/** * Verify the signature if necessary. * * @throws I2PException if the signature was necessary and it was invalid */ private void verifySignature(Packet packet, Connection con) throws I2PException { // verify the signature if necessary if (con.getOptions().getRequireFullySigned() || packet.isFlagSet(Packet.FLAG_SYNCHRONIZE | Packet.FLAG_CLOSE)) { // we need a valid signature Destination from = con.getRemotePeer(); if (from == null) from = packet.getOptionalFrom(); boolean sigOk = packet.verifySignature(_context, from, null); if (!sigOk) { throw new I2PException("Received unsigned / forged packet: " + packet); } } }