Skip to main content

encode_rs256

Function encode_rs256 

Source
pub fn encode_rs256(
    claims: &impl Serialize,
    private_key_pem: &str,
) -> Result<String, JwtError>
Expand description

Encode a claims struct as an RS256 JWT (RSA, PKCS#8 PEM key).

ยงErrors

Returns JwtError::Invalid for PEM parse or signing failures.