Function jws::compact::encode_sign
source · pub fn encode_sign(
header: JsonObject,
payload: &[u8],
signer: &impl Signer
) -> Result<EncodedSignedMessage>
Expand description
Encode and sign the message.
This function will first use to crate::Signer
to add header parameters to the header,
then encode the message and finally sign it.
Using this function ensures that the header parameters are set correctly before encoding/signing.