Exemplo n.º 1
0
 def test_unprotected(self):
     jwe = {
         'iv': '1234',
         'ciphertext': 'hello',
         'tag': '4567',
         'recipients': [{}],
         'unprotected': self.raw_claims,
     }
     self.assertDictEqual(jose.get_jwe_shared_header(jwe), self.raw_claims)
Exemplo n.º 2
0
 def test_protected(self):
     jwe = {
         'iv': '1234',
         'ciphertext': 'hello',
         'tag': '4567',
         'recipients': [{}],
         'protected': utils.base64url_encode(json.dumps(self.raw_claims)),
     }
     self.assertDictEqual(jose.get_jwe_shared_header(jwe), self.raw_claims)
Exemplo n.º 3
0
 def test_invalid_jwe(self):
     with self.assertRaises(exceptions.InvalidFormatError):
         jose.get_jwe_shared_header({})