()
| 31 | |
| 32 | |
| 33 | def test_invalid_header(): |
| 34 | jwe = JsonWebEncryption() |
| 35 | public_key = read_file_path("rsa_public.pem") |
| 36 | with pytest.raises(errors.MissingAlgorithmError): |
| 37 | jwe.serialize_compact({}, "a", public_key) |
| 38 | with pytest.raises(errors.UnsupportedAlgorithmError): |
| 39 | jwe.serialize_compact( |
| 40 | {"alg": "invalid"}, |
| 41 | "a", |
| 42 | public_key, |
| 43 | ) |
| 44 | with pytest.raises(errors.MissingEncryptionAlgorithmError): |
| 45 | jwe.serialize_compact( |
| 46 | {"alg": "RSA-OAEP"}, |
| 47 | "a", |
| 48 | public_key, |
| 49 | ) |
| 50 | with pytest.raises(errors.UnsupportedEncryptionAlgorithmError): |
| 51 | jwe.serialize_compact( |
| 52 | {"alg": "RSA-OAEP", "enc": "invalid"}, |
| 53 | "a", |
| 54 | public_key, |
| 55 | ) |
| 56 | with pytest.raises(errors.UnsupportedCompressionAlgorithmError): |
| 57 | jwe.serialize_compact( |
| 58 | {"alg": "RSA-OAEP", "enc": "A256GCM", "zip": "invalid"}, |
| 59 | "a", |
| 60 | public_key, |
| 61 | ) |
| 62 | |
| 63 | |
| 64 | def test_not_supported_alg(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…