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

Method decrypt_at_time

src/cryptography/fernet.py:92–100  ·  view source on GitHub ↗
(
        self, token: bytes | str, ttl: int, current_time: int
    )

Source from the content-addressed store, hash-verified

90 return self._decrypt_data(data, timestamp, time_info)
91
92 def decrypt_at_time(
93 self, token: bytes | str, ttl: int, current_time: int
94 ) -> bytes:
95 if ttl is None:
96 raise ValueError(
97 "decrypt_at_time() can only be used with a non-None ttl"
98 )
99 timestamp, data = Fernet._get_unverified_token_data(token)
100 return self._decrypt_data(data, timestamp, (ttl, current_time))
101
102 def extract_timestamp(self, token: bytes | str) -> int:
103 timestamp, data = Fernet._get_unverified_token_data(token)

Callers 4

test_verifyMethod · 0.95
test_invalidMethod · 0.95
decrypt_at_timeMethod · 0.45

Calls 2

_decrypt_dataMethod · 0.95

Tested by 3

test_verifyMethod · 0.76
test_invalidMethod · 0.76