The Jwk::thumbprint() function appears to incorrectly generate a thumbprint value using the unquoted crv string, which differs from how we're generating it above and how other implementations do it. It appears to have been a typo.
EllipticCurve::Ed25519 => {
format!(
r#"{{crv:{},"kty":{},"x":"{}"}}"#, // <--- Note that crv isn't double quoted.
serde_json::to_string(&a.curve).unwrap(),
serde_json::to_string(&a.key_type).unwrap(),
a.x,
)
}
Earlier:
AlgorithmParameters::EllipticCurve(a) => match a.curve {
EllipticCurve::P256 | EllipticCurve::P384 | EllipticCurve::P521 => {
format!(
r#"{{"crv":{},"kty":{},"x":"{}","y":"{}"}}"#,
serde_json::to_string(&a.curve).unwrap(),
serde_json::to_string(&a.key_type).unwrap(),
a.x,
a.y,
)
}
EllipticCurve::Ed25519 => panic!("EllipticCurve can't contain this curve type"),
},
I will submit a PR with a fix.
The Jwk::thumbprint() function appears to incorrectly generate a thumbprint value using the unquoted
crvstring, which differs from how we're generating it above and how other implementations do it. It appears to have been a typo.Earlier:
I will submit a PR with a fix.