MCPcopy Create free account
hub / github.com/Keats/jsonwebtoken / encode_wrong_alg_family

Function encode_wrong_alg_family

tests/hmac.rs:248–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246#[test]
247#[wasm_bindgen_test]
248fn encode_wrong_alg_family() {
249 let my_claims = Claims {
250 sub: "b@b.com".to_string(),
251 company: "ACME".to_string(),
252 exp: OffsetDateTime::now_utc().unix_timestamp() + 10000,
253 };
254 let claims = encode(&Header::default(), &my_claims, &EncodingKey::from_rsa_der(b"secret"));
255 assert_eq!(claims.unwrap_err().into_kind(), ErrorKind::InvalidAlgorithm);
256}
257
258#[test]
259#[wasm_bindgen_test]

Callers

nothing calls this directly

Calls 1

encodeFunction · 0.50

Tested by

no test coverage detected