/// Wraps the content into an envelope that contains the message signature.
///
/// Prerequisite: if `content` contains a `sender` field (this is the case for
/// queries, but not for request_status), then this 'sender' must be compatible
/// with the `keypair` argument.
Wraps the content into an envelope that contains the message signature.
Wraps the content into an envelope that contains the message signature .
pub fn sign_query(
    content: HttpQueryContent,
    sender: &Sender,
) -> Result<HttpRequestEnvelope<HttpQueryContent>, Box<dyn Error>> {
    let message_id = content.id();
    let pub_key_der = sender.sender_pubkey_der().map(Blob);
    let sender_sig = sender.sign_message_id(&message_id)?.map(Blob);
    Ok(HttpRequestEnvelope::<HttpQueryContent> {
        content,
        sender_pubkey: pub_key_der,
        sender_sig,
        sender_delegation: None,
    })
}
pub fn sign_query ( content : HttpQueryContent , sender : & Sender , ) -> Result < HttpRequestEnvelope < HttpQueryContent > , Box < dyn Error > > { let message_id = content . id ( ) ; let pub_key_der = sender . sender_pubkey_der ( ) . map ( Blob ) ; let sender_sig = sender . sign_message_id ( & message_id ) ? . map ( Blob ) ; Ok ( HttpRequestEnvelope :: < HttpQueryContent > { content , sender_pubkey : pub_key_der , sender_sig , sender_delegation : None , } ) }
Wraps the content into an envelope that contains the message signature.
Wraps the content into an envelope that contains the message signature .
content
HttpQueryContent
sender
&Sender