/** * Including sig. This does NOT validate the signature */ @Override public void writeBytes(OutputStream out) throws DataFormatException, IOException { if (_signature == null) throw new DataFormatException("Not enough data to write out a LeaseSet"); writeBytesWithoutSig(out); _signature.writeBytes(out); }
/** * This does NOT validate the signature */ public void writeBytes(OutputStream out) throws DataFormatException, IOException { if (_signature == null) throw new DataFormatException("Signature is null"); writeDataBytes(out); _signature.writeBytes(out); }
/** * This does NOT validate the signature */ public void writeBytes(OutputStream out) throws DataFormatException, IOException { if ((_destination == null) || (_encryptionKey == null) || (_signingKey == null) || (_signature == null)) throw new DataFormatException("Not enough data to write out a LeaseSet"); _destination.writeBytes(out); _encryptionKey.writeBytes(out); _signingKey.writeBytes(out); out.write((byte) _leases.size()); for (Lease lease : _leases) { lease.writeBytes(out); } _signature.writeBytes(out); }
public void writeBytes(OutputStream out) throws DataFormatException, IOException { if ((_destination == null) || (_options == null) || (_signature == null) || (_creationDate == null)) throw new DataFormatException("Not enough data to create the session config"); _destination.writeBytes(out); DataHelper.writeProperties(out, _options, true); // UTF-8 DataHelper.writeDate(out, _creationDate); _signature.writeBytes(out); }
protected void writeOfflineBytes(OutputStream out) throws DataFormatException, IOException { if (_transientSigningPublicKey == null || _offlineSignature == null) throw new DataFormatException("No offline key/sig"); DataHelper.writeLong(out, 4, _transientExpires / 1000); DataHelper.writeLong(out, 2, _transientSigningPublicKey.getType().getCode()); _transientSigningPublicKey.writeBytes(out); _offlineSignature.writeBytes(out); }
/** * Overridden because we have a blinded key, not a dest */ @Override protected void writeOfflineBytes(OutputStream out) throws DataFormatException, IOException { if (_transientSigningPublicKey == null || _offlineSignature == null) throw new DataFormatException("No offline key/sig"); DataHelper.writeLong(out, 4, _transientExpires / 1000); DataHelper.writeLong(out, 2, _signingKey.getType().getCode()); _transientSigningPublicKey.writeBytes(out); _offlineSignature.writeBytes(out); }
signature.writeBytes(out); ok = true; } catch (DataFormatException dfe) {
sig = dsaEng.sign(payload, sxPrivKey); sig.writeBytes(sxDGram); sxDGram.write(payload); if (sxDGram.size() > DGRAM_BUFSIZE)
/** * Copied from I2PClientImpl.createDestination() */ public void write() throws IOException, DataFormatException { OutputStream out = null; try { out = new SecureFileOutputStream(this.file); this.dest.writeBytes(out); this.privKey.writeBytes(out); this.signingPrivKey.writeBytes(out); if (isOffline()) { DataHelper.writeLong(out, 4, _offlineExpiration / 1000); DataHelper.writeLong(out, 2, _transientSigningPubKey.getType().getCode()); _transientSigningPubKey.writeBytes(out); _offlineSignature.writeBytes(out); _transientSigningPrivKey.writeBytes(out); } } finally { if (out != null) { try { out.close(); } catch (IOException ioe) {} } } }
dsaEng.sign(Hash.FAKE_HASH.toByteArray(), session.getPrivateKey()).writeBytes(dout); dout.write(DataHelper.getASCII("blah"));