massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / cryptography / cryptography / hazmat / primitives / serialization / __init__.pyi
1 from abc import ABCMeta
2 from enum import Enum
3 from typing import Any
4
5 from cryptography.hazmat.backends.interfaces import (
6     DERSerializationBackend,
7     DSABackend,
8     EllipticCurveBackend,
9     PEMSerializationBackend,
10     RSABackend,
11 )
12
13 def load_pem_private_key(
14     data: bytes, password: bytes | None, backend: PEMSerializationBackend | None = ...
15 ) -> Any: ...  # actually RSAPrivateKey | DSAPrivateKey | DHPrivateKey | EllipticCurvePrivateKey
16 def load_pem_public_key(
17     data: bytes, backend: PEMSerializationBackend | None = ...
18 ) -> Any: ...  # actually RSAPublicKey | DSAPublicKey | DHPublicKey | EllipticCurvePublicKey
19 def load_der_private_key(
20     data: bytes, password: bytes | None, backend: DERSerializationBackend | None = ...
21 ) -> Any: ...  # actually RSAPrivateKey | DSAPrivateKey | DHPrivateKey | EllipticCurvePrivateKey
22 def load_der_public_key(
23     data: bytes, backend: DERSerializationBackend | None = ...
24 ) -> Any: ...  # actually RSAPublicKey | DSAPublicKey | DHPublicKey | EllipticCurvePublicKey
25 def load_ssh_public_key(
26     data: bytes, backend: RSABackend | DSABackend | EllipticCurveBackend | None = ...
27 ) -> Any: ...  # actually RSAPublicKey | DSAPublicKey | DHPublicKey | EllipticCurvePublicKey | Ed25519PublicKey
28
29 class Encoding(Enum):
30     PEM: str
31     DER: str
32     OpenSSH: str
33     Raw: str
34     X962: str
35     SMIME: str
36
37 class PrivateFormat(Enum):
38     PKCS8: str
39     TraditionalOpenSSL: str
40     Raw: str
41     OpenSSH: str
42
43 class PublicFormat(Enum):
44     SubjectPublicKeyInfo: str
45     PKCS1: str
46     OpenSSH: str
47     Raw: str
48     CompressedPoint: str
49     UncompressedPoint: str
50
51 class ParameterFormat(Enum):
52     PKCS3: str
53
54 class KeySerializationEncryption(metaclass=ABCMeta): ...
55
56 class BestAvailableEncryption(KeySerializationEncryption):
57     password: bytes
58     def __init__(self, password: bytes) -> None: ...
59
60 class NoEncryption(KeySerializationEncryption): ...