massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / cryptography / cryptography / fernet.pyi
diff --git a/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/typeshed-fallback/stubs/cryptography/cryptography/fernet.pyi b/.config/coc/extensions/node_modules/coc-pyright/node_modules/pyright/dist/typeshed-fallback/stubs/cryptography/cryptography/fernet.pyi
new file mode 100644 (file)
index 0000000..2eb1e18
--- /dev/null
@@ -0,0 +1,25 @@
+from typing import Text
+
+class InvalidToken(Exception): ...
+
+class Fernet(object):
+    def __init__(self, key: bytes | Text) -> None: ...
+    def decrypt(self, token: bytes, ttl: int | None = ...) -> bytes: ...
+    # decrypt_at_time accepts None ttl at runtime but it's an implementtion detail and it doesn't really
+    # make sense for the client code to use it like that, so the parameter is typed as int as opposed to
+    # int | None.
+    def decrypt_at_time(self, token: bytes, ttl: int, current_time: int) -> bytes: ...
+    def encrypt(self, data: bytes) -> bytes: ...
+    def encrypt_at_time(self, data: bytes, current_time: int) -> bytes: ...
+    def extract_timestamp(self, token: bytes) -> int: ...
+    @classmethod
+    def generate_key(cls) -> bytes: ...
+
+class MultiFernet(object):
+    def __init__(self, fernets: list[Fernet]) -> None: ...
+    def decrypt(self, token: bytes, ttl: int | None = ...) -> bytes: ...
+    # See a note above on the typing of the ttl parameter.
+    def decrypt_at_time(self, token: bytes, ttl: int, current_time: int) -> bytes: ...
+    def encrypt(self, data: bytes) -> bytes: ...
+    def encrypt_at_time(self, data: bytes, current_time: int) -> bytes: ...
+    def rotate(self, msg: bytes) -> bytes: ...