Skip to main content

encode_compact

Function encode_compact 

Source
pub fn encode_compact(
    header: &JwtHeader,
    claims: &JwtClaims,
    signer: &AnySigningKey,
) -> Result<String, JwtError>
Expand description

Encode a JWT in compact form: base64url(header).base64url(claims).base64url(signature).

Signs the concatenation header_b64 + "." + claims_b64 with SHA-256 prehash under the supplied key. Returns the full compact token string.