pub fn encode<T: Serialize>(
header: &Header,
claims: Option<&T>,
key: &EncodingKey,
) -> Result<Jws<T>>Expand description
Encode the header and claims given and sign the payload using the algorithm from the header and the key.
If the algorithm given is RSA or EC, the key needs to be in the PEM format. This produces a JWS instead of
a JWT – usage is similar to encode, see that for more details.