public GetPubkey(BitmessageAddress address) { super(address.getVersion()); this.stream = address.getStream(); if (address.getVersion() < 4) this.ripeTag = address.getRipe(); else this.ripeTag = address.getTag(); }
public void encrypt(byte[] publicEncryptionKey) throws IOException { if (payload instanceof Encrypted) { ((Encrypted) payload).encrypt(publicEncryptionKey); } }
public Msg(Plaintext plaintext) { super(1); this.stream = plaintext.getStream(); this.plaintext = plaintext; }
public static ObjectMessage createAck(Plaintext plaintext) { if (plaintext == null || plaintext.getAckData() == null) return null; GenericPayload ack = new GenericPayload(3, plaintext.getFrom().getStream(), plaintext.getAckData()); return new ObjectMessage.Builder().objectType(MSG).payload(ack).expiresTime(UnixTime.now(plaintext.getTTL())).build(); } }
public static Plaintext read(Type type, InputStream in) throws IOException { return readWithoutSignature(type, in) .signature(Decode.varBytes(in)) .build(); }
public static BitmessageAddress chan(String address, String passphrase) { BitmessageAddress result = new BitmessageAddress(address, passphrase); result.chan = true; return result; }
public void decrypt(byte[] privateEncryptionKey) throws IOException, DecryptionFailedException { if (payload instanceof Encrypted) { ((Encrypted) payload).decrypt(privateEncryptionKey); } }
@Override public void setSignature(byte[] signature) { plaintext.setSignature(signature); }
public Inv build() { return new Inv(this); } }
@Override public void markAsAcknowledged(Plaintext msg) { msg.setStatus(SENT_ACKNOWLEDGED); }
public Version build() { return new Version(this); } }
@Override public byte[] getSignature() { return plaintext.getSignature(); }
@Override public void write(OutputStream out) throws IOException { write(out, true); }
public Addr build() { return new Addr(this); } }
public GetPubkey(BitmessageAddress address) { super(address.getVersion()); this.stream = address.getStream(); if (address.getVersion() < 4) this.ripeTag = address.getRipe(); else this.ripeTag = address.getTag(); }
public void encrypt(byte[] publicEncryptionKey) throws IOException { if (payload instanceof Encrypted) { ((Encrypted) payload).encrypt(publicEncryptionKey); } }
public Msg(Plaintext plaintext) { super(1); this.stream = plaintext.getStream(); this.plaintext = plaintext; }
public void decrypt(byte[] privateEncryptionKey) throws IOException, DecryptionFailedException { if (payload instanceof Encrypted) { ((Encrypted) payload).decrypt(privateEncryptionKey); } }
@Override public void setSignature(byte[] signature) { plaintext.setSignature(signature); }
public Inv build() { return new Inv(this); } }