Open x86y opened 7 months ago
Hi. First of all, thanks for josekit.
I'm trying to port my javascript code to rust using josekit-rs. Specifically the following code:
let JWK_KEY = { "kty": ("RSA"), "e": ("AQAB"), "kid": ("5fe64480-444f-4d4a-af27-aa2a750239af"), "n": ("3NxCce6lBGfYCDCMejT1mc9Y0YmGx-S6herOLq6DQw1hyULsKsdOLWM47hAfxL4tTx1Y-lE082xyuKg96a9zXhoGiEvwXYFJAMxtQUcbxvTLYy2rtgclVok5UkOIE1IoYPnZ8EqTDk7YcWwxfRPGw-o1Kpuq7cB5Eymvoiq7x566PSPDFkZZGBdvlhNNK1qgUyEtpAxI9_6zfiKHVjmJjzAGh9UoiKiWAEIFUwB-SayhekZmDvM1h2OwOeinIA19R4dwloP1HtdRyuTLKxfppixgMDiWi6EO_xsY5FJwsO0Ak7ydLu3avI8_ZtwZOCYDzH7xz9ISecWkctiPHDHMBw"), } JWE.createEncrypt({format: "compact"}, JWK_KEY).update(payload).final()
I've used the following rust
let mut payload = JwtPayload::new(); let JWK_KEY: Map<String, serde_json::Value> = (THE_ABOVE_JSON).as_object().unwrap().clone(); payload.set_subject(...); let mut header = JweHeader::new(); header.set_content_encryption("A128CBC-HS256"); let key = Jwk::from_map(JWK_KEY)?; let enc = josekit::jwe::RSA_OAEP.encrypter_from_jwk(&key)?; let jwt = jwt::encode_with_encrypter(&payload, &header, &enc)?;
The final encoded jwt s are not equal, but the JWK_KEY and payload are indeed equal
Hi. First of all, thanks for josekit.
I'm trying to port my javascript code to rust using josekit-rs. Specifically the following code:
I've used the following rust
The final encoded jwt s are not equal, but the JWK_KEY and payload are indeed equal