public bool Write(AlternativeCompositeByteBuf buffer, Message message, ISignatureCodec signatureCodec) { Message = message; Logger.Debug("Message for outbound {0}.", message); if (!_header) { MessageHeaderCodec.EncodeHeader(buffer, message); _header = true; } else { Logger.Debug("Send a follow-up message {0}.", message); _resume = true; } bool done = Loop(buffer); Logger.Debug("Message encoded {0}.", message); // write out what we have if (buffer.IsReadable && done) { // check if message needs to be signed if (message.IsSign) { // we sign if we did not provide a signature already if (signatureCodec == null) { signatureCodec = _signatureFactory.Sign(message.PrivateKey, buffer); } // in case of relay, we have a signature, so we need to resuse this signatureCodec.Write(buffer); } } return(done); }
public Message SetReceivedSignature(ISignatureCodec signatureEncode) { ReceivedSignature = signatureEncode; return this; }
public bool Verify(IPublicKey publicKey, ByteBuf buffer, ISignatureCodec signatureEncoded) { throw new NotImplementedException(); }
public Message SetReceivedSignature(ISignatureCodec signatureEncode) { ReceivedSignature = signatureEncode; return(this); }
public Data SetSignature(ISignatureCodec signature) { Signature = signature; return(this); }