MCPcopy
hub / github.com/pyca/cryptography / test_rotate_decrypt_no_shared_keys

Method test_rotate_decrypt_no_shared_keys

tests/test_fernet.py:271–279  ·  view source on GitHub ↗
(self, backend)

Source from the content-addressed store, hash-verified

269 assert original_time == rotated_time
270
271 def test_rotate_decrypt_no_shared_keys(self, backend):
272 f1 = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend)
273 f2 = Fernet(base64.urlsafe_b64encode(b"\x01" * 32), backend=backend)
274
275 mf1 = MultiFernet([f1])
276 mf2 = MultiFernet([f2])
277
278 with pytest.raises(InvalidToken):
279 mf2.rotate(mf1.encrypt(b"abc"))
280
281 def test_extract_timestamp_first_fernet_valid_token(self, backend):
282 f1 = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend)

Callers

nothing calls this directly

Calls 4

rotateMethod · 0.95
encryptMethod · 0.95
FernetClass · 0.90
MultiFernetClass · 0.90

Tested by

no test coverage detected