()
| 223 | |
| 224 | |
| 225 | def test_aes_gcm_jwe(): |
| 226 | jwe = JsonWebEncryption() |
| 227 | sizes = [128, 192, 256] |
| 228 | _enc_choices = [ |
| 229 | "A128CBC-HS256", |
| 230 | "A192CBC-HS384", |
| 231 | "A256CBC-HS512", |
| 232 | "A128GCM", |
| 233 | "A192GCM", |
| 234 | "A256GCM", |
| 235 | ] |
| 236 | for s in sizes: |
| 237 | alg = f"A{s}GCMKW" |
| 238 | key = os.urandom(s // 8) |
| 239 | for enc in _enc_choices: |
| 240 | protected = {"alg": alg, "enc": enc} |
| 241 | data = jwe.serialize_compact(protected, b"hello", key) |
| 242 | rv = jwe.deserialize_compact(data, key) |
| 243 | assert rv["payload"] == b"hello" |
| 244 | |
| 245 | |
| 246 | def test_aes_gcm_jwe_invalid_key(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…