types-awscrt 0.29.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. awscrt-stubs/__init__.pyi +33 -0
  2. awscrt-stubs/_test.pyi +15 -0
  3. awscrt-stubs/aio/__init__.pyi +9 -0
  4. awscrt-stubs/aio/http.pyi +104 -0
  5. awscrt-stubs/auth.pyi +158 -0
  6. awscrt-stubs/cbor.pyi +77 -0
  7. awscrt-stubs/checksums.pyi +9 -0
  8. awscrt-stubs/common.pyi +9 -0
  9. awscrt-stubs/crypto.pyi +121 -0
  10. awscrt-stubs/eventstream/__init__.pyi +60 -0
  11. awscrt-stubs/eventstream/rpc.pyi +131 -0
  12. awscrt-stubs/exceptions.pyi +13 -0
  13. awscrt-stubs/http.pyi +203 -0
  14. awscrt-stubs/io.pyi +158 -0
  15. awscrt-stubs/mqtt.pyi +141 -0
  16. awscrt-stubs/mqtt5.pyi +398 -0
  17. awscrt-stubs/mqtt_request_response.pyi +81 -0
  18. awscrt-stubs/py.typed +0 -0
  19. awscrt-stubs/s3.pyi +180 -0
  20. awscrt-stubs/websocket.pyi +106 -0
  21. build/lib/awscrt-stubs/__init__.pyi +33 -0
  22. build/lib/awscrt-stubs/_test.pyi +15 -0
  23. build/lib/awscrt-stubs/aio/__init__.pyi +9 -0
  24. build/lib/awscrt-stubs/aio/http.pyi +104 -0
  25. build/lib/awscrt-stubs/auth.pyi +158 -0
  26. build/lib/awscrt-stubs/cbor.pyi +77 -0
  27. build/lib/awscrt-stubs/checksums.pyi +9 -0
  28. build/lib/awscrt-stubs/common.pyi +9 -0
  29. build/lib/awscrt-stubs/crypto.pyi +121 -0
  30. build/lib/awscrt-stubs/eventstream/__init__.pyi +60 -0
  31. build/lib/awscrt-stubs/eventstream/rpc.pyi +131 -0
  32. build/lib/awscrt-stubs/exceptions.pyi +13 -0
  33. build/lib/awscrt-stubs/http.pyi +203 -0
  34. build/lib/awscrt-stubs/io.pyi +158 -0
  35. build/lib/awscrt-stubs/mqtt.pyi +141 -0
  36. build/lib/awscrt-stubs/mqtt5.pyi +398 -0
  37. build/lib/awscrt-stubs/mqtt_request_response.pyi +81 -0
  38. build/lib/awscrt-stubs/py.typed +0 -0
  39. build/lib/awscrt-stubs/s3.pyi +180 -0
  40. build/lib/awscrt-stubs/websocket.pyi +106 -0
  41. types_awscrt-0.29.0.dist-info/METADATA +97 -0
  42. types_awscrt-0.29.0.dist-info/RECORD +45 -0
  43. types_awscrt-0.29.0.dist-info/WHEEL +5 -0
  44. types_awscrt-0.29.0.dist-info/licenses/LICENSE +21 -0
  45. types_awscrt-0.29.0.dist-info/top_level.txt +4 -0
@@ -0,0 +1,33 @@
1
+ """
2
+ Type annotations for awscrt module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from awscrt import aio as aio
8
+ from awscrt import auth as auth
9
+ from awscrt import crypto as crypto
10
+ from awscrt import http as http
11
+ from awscrt import io as io
12
+ from awscrt import mqtt as mqtt
13
+ from awscrt import mqtt5 as mqtt5
14
+ from awscrt import mqtt_request_response as mqtt_request_response
15
+ from awscrt import s3 as s3
16
+ from awscrt import websocket as websocket
17
+
18
+ __all__ = [
19
+ "aio",
20
+ "auth",
21
+ "crypto",
22
+ "http",
23
+ "io",
24
+ "mqtt",
25
+ "mqtt5",
26
+ "mqtt_request_response",
27
+ "s3",
28
+ "websocket",
29
+ ]
30
+ __version__: str = ...
31
+
32
+ class NativeResource:
33
+ def __init__(self) -> None: ...
awscrt-stubs/_test.pyi ADDED
@@ -0,0 +1,15 @@
1
+ """
2
+ Type annotations for awscrt._test module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from awscrt import NativeResource as NativeResource
8
+ from awscrt.io import ClientBootstrap as ClientBootstrap
9
+ from awscrt.io import DefaultHostResolver as DefaultHostResolver
10
+ from awscrt.io import EventLoopGroup as EventLoopGroup
11
+
12
+ def native_memory_usage() -> int: ...
13
+ def dump_native_memory() -> None: ...
14
+ def join_all_native_threads(*, timeout_sec: float = ...) -> bool: ...
15
+ def check_for_leaks(*, timeout_sec: float = ...) -> None: ...
@@ -0,0 +1,9 @@
1
+ """
2
+ Type annotations for awscrt.aio module.
3
+
4
+ Copyright 2025 Vlad Emelianov
5
+ """
6
+
7
+ from awscrt.aio import http
8
+
9
+ __all__ = ["http"]
@@ -0,0 +1,104 @@
1
+ """
2
+ Type annotations for awscrt.aio.http module.
3
+
4
+ Copyright 2025 Vlad Emelianov
5
+ """
6
+
7
+ import asyncio
8
+ from typing import AsyncIterator, Callable
9
+
10
+ from awscrt.http import (
11
+ Http2Setting,
12
+ HttpClientConnectionBase,
13
+ HttpClientStreamBase,
14
+ HttpProxyOptions,
15
+ HttpRequest,
16
+ )
17
+ from awscrt.io import ClientBootstrap, SocketOptions, TlsConnectionOptions
18
+
19
+ class AIOHttpClientConnectionUnified(HttpClientConnectionBase):
20
+ @classmethod
21
+ async def new(
22
+ cls,
23
+ host_name: str,
24
+ port: int,
25
+ bootstrap: ClientBootstrap | None = ...,
26
+ socket_options: SocketOptions | None = ...,
27
+ tls_connection_options: TlsConnectionOptions | None = ...,
28
+ proxy_options: HttpProxyOptions | None = ...,
29
+ ) -> AIOHttpClientConnectionUnified: ...
30
+ async def close(self) -> None: ...
31
+ def request(
32
+ self,
33
+ request: HttpRequest,
34
+ request_body_generator: AsyncIterator[bytes] | None = ...,
35
+ loop: asyncio.AbstractEventLoop | None = ...,
36
+ ) -> AIOHttpClientStreamUnified: ...
37
+
38
+ class AIOHttpClientConnection(AIOHttpClientConnectionUnified):
39
+ @classmethod
40
+ async def new(
41
+ cls,
42
+ host_name: str,
43
+ port: int,
44
+ bootstrap: ClientBootstrap | None = ...,
45
+ socket_options: SocketOptions | None = ...,
46
+ tls_connection_options: TlsConnectionOptions | None = ...,
47
+ proxy_options: HttpProxyOptions | None = ...,
48
+ ) -> AIOHttpClientConnection: ...
49
+ def request(
50
+ self,
51
+ request: HttpRequest,
52
+ request_body_generator: AsyncIterator[bytes] | None = ...,
53
+ loop: asyncio.AbstractEventLoop | None = ...,
54
+ ) -> AIOHttpClientStream: ...
55
+
56
+ class AIOHttp2ClientConnection(AIOHttpClientConnectionUnified):
57
+ @classmethod
58
+ async def new(
59
+ cls,
60
+ host_name: str,
61
+ port: int,
62
+ bootstrap: ClientBootstrap | None = ...,
63
+ socket_options: SocketOptions | None = ...,
64
+ tls_connection_options: TlsConnectionOptions | None = ...,
65
+ proxy_options: HttpProxyOptions | None = ...,
66
+ initial_settings: list[Http2Setting] | None = ...,
67
+ on_remote_settings_changed: Callable[[list[Http2Setting]], None] | None = ...,
68
+ ) -> AIOHttp2ClientConnection: ...
69
+ def request(
70
+ self,
71
+ request: HttpRequest,
72
+ request_body_generator: AsyncIterator[bytes] | None = ...,
73
+ loop: asyncio.AbstractEventLoop | None = ...,
74
+ ) -> AIOHttp2ClientStream: ...
75
+
76
+ class AIOHttpClientStreamUnified(HttpClientStreamBase):
77
+ def __init__(
78
+ self,
79
+ connection: AIOHttpClientConnection,
80
+ request: HttpRequest,
81
+ request_body_generator: AsyncIterator[bytes] | None = ...,
82
+ loop: asyncio.AbstractEventLoop | None = ...,
83
+ ) -> None: ...
84
+ async def get_response_status_code(self) -> int: ...
85
+ async def get_response_headers(self) -> list[tuple[str, str]]: ...
86
+ async def get_next_response_chunk(self) -> bytes: ...
87
+ async def wait_for_completion(self) -> int: ...
88
+
89
+ class AIOHttpClientStream(AIOHttpClientStreamUnified):
90
+ def __init__(
91
+ self,
92
+ connection: AIOHttpClientConnection,
93
+ request: HttpRequest,
94
+ loop: asyncio.AbstractEventLoop | None = ...,
95
+ ) -> None: ...
96
+
97
+ class AIOHttp2ClientStream(AIOHttpClientStreamUnified):
98
+ def __init__(
99
+ self,
100
+ connection: AIOHttpClientConnection,
101
+ request: HttpRequest,
102
+ request_body_generator: AsyncIterator[bytes] | None = ...,
103
+ loop: asyncio.AbstractEventLoop | None = ...,
104
+ ) -> None: ...
awscrt-stubs/auth.pyi ADDED
@@ -0,0 +1,158 @@
1
+ """
2
+ Type annotations for awscrt.auth module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from concurrent.futures import Future
8
+ from datetime import datetime
9
+ from enum import IntEnum
10
+ from typing import Any, Callable, Sequence, TypeVar
11
+
12
+ from awscrt import NativeResource as NativeResource
13
+ from awscrt.http import HttpProxyOptions
14
+ from awscrt.http import HttpRequest as HttpRequest
15
+ from awscrt.io import ClientBootstrap as ClientBootstrap
16
+ from awscrt.io import ClientTlsContext
17
+
18
+ _R = TypeVar("_R")
19
+
20
+ class AwsCredentials(NativeResource):
21
+ def __init__(
22
+ self,
23
+ access_key_id: str,
24
+ secret_access_key: str,
25
+ session_token: str | None = ...,
26
+ expiration: datetime | None = ...,
27
+ ) -> None: ...
28
+ @property
29
+ def access_key_id(self) -> str: ...
30
+ @property
31
+ def secret_access_key(self) -> str: ...
32
+ @property
33
+ def session_token(self) -> str: ...
34
+ @property
35
+ def expiration(self) -> datetime | None: ...
36
+ def __deepcopy__(self: _R, memo: Any) -> _R: ...
37
+
38
+ class AwsCredentialsProviderBase(NativeResource): ...
39
+
40
+ class AwsCredentialsProvider(AwsCredentialsProviderBase):
41
+ def __init__(self, binding: Any) -> None: ...
42
+ @classmethod
43
+ def new_default_chain(cls: type[_R], client_bootstrap: ClientBootstrap | None = ...) -> _R: ...
44
+ @classmethod
45
+ def new_static(
46
+ cls: type[_R],
47
+ access_key_id: str,
48
+ secret_access_key: str,
49
+ session_token: str | None = ...,
50
+ ) -> _R: ...
51
+ @classmethod
52
+ def new_profile(
53
+ cls: type[_R],
54
+ client_bootstrap: ClientBootstrap | None = ...,
55
+ profile_name: str | None = ...,
56
+ config_filepath: str | None = ...,
57
+ credentials_filepath: str | None = ...,
58
+ ) -> _R: ...
59
+ @classmethod
60
+ def new_process(cls: type[_R], profile_to_use: str | None = ...) -> _R: ...
61
+ @classmethod
62
+ def new_environment(cls: type[_R]) -> _R: ...
63
+ @classmethod
64
+ def new_chain(cls: type[_R], providers: list[AwsCredentialsProvider]) -> _R: ...
65
+ @classmethod
66
+ def new_delegate(cls: type[_R], get_credentials: Callable[[], AwsCredentials]) -> _R: ...
67
+ @classmethod
68
+ def new_cognito(
69
+ cls: type[_R],
70
+ *,
71
+ endpoint: str,
72
+ identity: str,
73
+ tls_ctx: ClientTlsContext,
74
+ logins: Sequence[tuple[str, str]] | None = ...,
75
+ custom_role_arn: str | None = ...,
76
+ client_bootstrap: ClientBootstrap | None = ...,
77
+ http_proxy_options: HttpProxyOptions | None = ...,
78
+ ) -> _R: ...
79
+ @classmethod
80
+ def new_x509(
81
+ cls: type[_R],
82
+ *,
83
+ endpoint: str,
84
+ thing_name: str,
85
+ role_alias: str,
86
+ tls_ctx: ClientTlsContext,
87
+ client_bootstrap: ClientBootstrap | None = ...,
88
+ http_proxy_options: HttpProxyOptions | None = ...,
89
+ ) -> _R: ...
90
+ def get_credentials(self) -> Future[AwsCredentials]: ...
91
+
92
+ class AwsSigningAlgorithm(IntEnum):
93
+ V4 = 0
94
+ V4_ASYMMETRIC = 1
95
+ V4_S3EXPRESS = 2
96
+
97
+ class AwsSignatureType(IntEnum):
98
+ HTTP_REQUEST_HEADERS = 0
99
+ HTTP_REQUEST_QUERY_PARAMS = 1
100
+
101
+ class AwsSignedBodyValue:
102
+ EMPTY_SHA256: str
103
+ UNSIGNED_PAYLOAD: str
104
+ STREAMING_AWS4_HMAC_SHA256_PAYLOAD: str
105
+ STREAMING_AWS4_HMAC_SHA256_EVENTS: str
106
+
107
+ class AwsSignedBodyHeaderType(IntEnum):
108
+ NONE = 0
109
+ X_AMZ_CONTENT_SHA_256 = 1
110
+
111
+ class AwsSigningConfig(NativeResource):
112
+ def __init__(
113
+ self,
114
+ algorithm: AwsSigningAlgorithm = ...,
115
+ signature_type: AwsSignatureType = ...,
116
+ credentials_provider: AwsCredentialsProvider | None = ...,
117
+ region: str = ...,
118
+ service: str = ...,
119
+ date: datetime | None = ...,
120
+ should_sign_header: Callable[[str], bool] | None = ...,
121
+ use_double_uri_encode: bool = ...,
122
+ should_normalize_uri_path: bool = ...,
123
+ signed_body_value: str | None = ...,
124
+ signed_body_header_type: AwsSignedBodyHeaderType = ...,
125
+ expiration_in_seconds: int | None = ...,
126
+ omit_session_token: bool = ...,
127
+ ) -> None: ...
128
+ def replace(self: _R, **kwargs: Any) -> _R: ...
129
+ @property
130
+ def algorithm(self) -> AwsSigningAlgorithm: ...
131
+ @property
132
+ def signature_type(self) -> AwsSignatureType: ...
133
+ @property
134
+ def credentials_provider(self) -> AwsCredentialsProvider: ...
135
+ @property
136
+ def region(self) -> str: ...
137
+ @property
138
+ def service(self) -> str: ...
139
+ @property
140
+ def date(self) -> datetime: ...
141
+ @property
142
+ def should_sign_header(self) -> Callable[[str], bool] | None: ...
143
+ @property
144
+ def use_double_uri_encode(self) -> bool: ...
145
+ @property
146
+ def should_normalize_uri_path(self) -> bool: ...
147
+ @property
148
+ def signed_body_value(self) -> str | None: ...
149
+ @property
150
+ def signed_body_header_type(self) -> AwsSignedBodyHeaderType: ...
151
+ @property
152
+ def expiration_in_seconds(self) -> int | None: ...
153
+ @property
154
+ def omit_session_token(self) -> bool: ...
155
+
156
+ def aws_sign_request(
157
+ http_request: HttpRequest, signing_config: AwsSigningConfig
158
+ ) -> Future[HttpRequest]: ...
awscrt-stubs/cbor.pyi ADDED
@@ -0,0 +1,77 @@
1
+ """
2
+ Type annotations for awscrt.cbor module.
3
+
4
+ Copyright 2025 Vlad Emelianov
5
+ """
6
+
7
+ from enum import IntEnum
8
+ from typing import Any, Callable
9
+
10
+ from awscrt import NativeResource
11
+
12
+ class AwsCborType(IntEnum):
13
+ Unknown = 0
14
+ UnsignedInt = 1
15
+ NegativeInt = 2
16
+ Float = 3
17
+ Bytes = 4
18
+ Text = 5
19
+ ArrayStart = 6
20
+ MapStart = 7
21
+ Tag = 8
22
+ Bool = 9
23
+ Null = 10
24
+ Undefined = 11
25
+ Break = 12
26
+ IndefBytes = 13
27
+ IndefStr = 14
28
+ IndefArray = 15
29
+ IndefMap = 16
30
+
31
+ class AwsCborEncoder(NativeResource):
32
+ def __init__(self) -> None: ...
33
+ def get_encoded_data(self) -> bytes: ...
34
+ def reset(self) -> None: ...
35
+ def write_int(self, val: int) -> None: ...
36
+ def write_float(self, val: float) -> None: ...
37
+ def write_bytes(self, val: bytes) -> None: ...
38
+ def write_text(self, val: str) -> None: ...
39
+ def write_array_start(self, number_entries: int) -> None: ...
40
+ def write_map_start(self, number_entries: int) -> None: ...
41
+ def write_tag(self, tag_number: int) -> None: ...
42
+ def write_null(self) -> None: ...
43
+ def write_undefined(self) -> None: ...
44
+ def write_indef_array_start(self) -> None: ...
45
+ def write_indef_map_start(self) -> None: ...
46
+ def write_indef_bytes_start(self) -> None: ...
47
+ def write_indef_text_start(self) -> None: ...
48
+ def write_break(self) -> None: ...
49
+ def write_bool(self, val: bool) -> None: ...
50
+ def write_epoch_time(self, val: float) -> None: ...
51
+ def write_list(self, val: list[Any]) -> None: ...
52
+ def write_dict(self, val: dict[Any, Any]) -> None: ...
53
+ def write_data_item(self, data_item: Any) -> None: ...
54
+
55
+ class AwsCborDecoder(NativeResource):
56
+ def __init__(
57
+ self, src: bytes, on_epoch_time: Callable[[float], Any] | None = ..., **kwargs: Any
58
+ ) -> None: ...
59
+ def _on_epoch_time_callback(self, epoch_secs: float) -> Any: ...
60
+ def peek_next_type(self) -> AwsCborType: ...
61
+ def get_remaining_bytes_len(self) -> int: ...
62
+ def get_remaining_bytes(self) -> bytes: ...
63
+ def reset_src(self, src: bytes) -> None: ...
64
+ def consume_next_single_element(self) -> None: ...
65
+ def consume_next_whole_data_item(self) -> None: ...
66
+ def pop_next_unsigned_int(self) -> int: ...
67
+ def pop_next_negative_int(self) -> int: ...
68
+ def pop_next_double(self) -> float: ...
69
+ def pop_next_bool(self) -> bool: ...
70
+ def pop_next_bytes(self) -> bytes: ...
71
+ def pop_next_text(self) -> str: ...
72
+ def pop_next_array_start(self) -> int: ...
73
+ def pop_next_map_start(self) -> int: ...
74
+ def pop_next_tag_val(self) -> int: ...
75
+ def pop_next_list(self) -> list[Any]: ...
76
+ def pop_next_map(self) -> dict[Any, Any]: ...
77
+ def pop_next_data_item(self) -> Any: ...
@@ -0,0 +1,9 @@
1
+ """
2
+ Type annotations for awscrt.checksums module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ def crc32(input: bytes, previous_crc32: int = ...) -> int: ...
8
+ def crc32c(input: bytes, previous_crc32c: int = ...) -> int: ...
9
+ def crc64nvme(input: bytes, previous_crc64nvme: int = 0) -> int: ...
@@ -0,0 +1,9 @@
1
+ """
2
+ Type annotations for awscrt.common module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ def get_cpu_group_count() -> int: ...
8
+ def get_cpu_count_for_group(group_idx: int) -> int: ...
9
+ def join_all_native_threads(*, timeout_sec: float = ...) -> bool: ...
@@ -0,0 +1,121 @@
1
+ """
2
+ Type annotations for awscrt.crypto module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from enum import IntEnum
8
+ from typing import Any, NamedTuple
9
+
10
+ from awscrt import NativeResource
11
+
12
+ class Hash:
13
+ def __init__(self, native_handle: Any) -> None: ...
14
+ @staticmethod
15
+ def sha1_new() -> Hash: ...
16
+ @staticmethod
17
+ def sha256_new() -> Hash: ...
18
+ @staticmethod
19
+ def md5_new() -> Hash: ...
20
+ def update(self, to_hash: Any) -> None: ...
21
+ def digest(self, truncate_to: int = ...) -> str: ...
22
+
23
+ class HMAC:
24
+ def __init__(self, native_handle: Any) -> None: ...
25
+ @staticmethod
26
+ def sha256_hmac_new(secret_key: str) -> HMAC: ...
27
+ def update(self, to_hmac: Any) -> None: ...
28
+ def digest(self, truncate_to: int = ...) -> str: ...
29
+
30
+ class RSAEncryptionAlgorithm(IntEnum):
31
+ PKCS1_5 = 0
32
+ OAEP_SHA256 = 1
33
+ OAEP_SHA512 = 2
34
+
35
+ class RSASignatureAlgorithm(IntEnum):
36
+ PKCS1_5_SHA256 = 0
37
+ PKCS1_5_SHA1 = 1
38
+ PSS_SHA256 = 2
39
+
40
+ class RSA(NativeResource):
41
+ def __init__(self, binding: Any) -> None: ...
42
+ @staticmethod
43
+ def new_private_key_from_pem_data(
44
+ pem_data: str | bytes | bytearray | memoryview,
45
+ ) -> RSA: ...
46
+ @staticmethod
47
+ def new_public_key_from_pem_data(
48
+ pem_data: str | bytes | bytearray | memoryview,
49
+ ) -> RSA: ...
50
+ @staticmethod
51
+ def new_private_key_from_der_data(
52
+ der_data: str | bytes | bytearray | memoryview,
53
+ ) -> RSA: ...
54
+ @staticmethod
55
+ def new_public_key_from_der_data(der_data: bytes | bytearray | memoryview) -> RSA: ...
56
+ def encrypt(
57
+ self,
58
+ encryption_algorithm: RSAEncryptionAlgorithm,
59
+ plaintext: bytes | bytearray | memoryview,
60
+ ) -> bytes: ...
61
+ def decrypt(
62
+ self,
63
+ encryption_algorithm: RSAEncryptionAlgorithm,
64
+ ciphertext: bytes | bytearray | memoryview,
65
+ ) -> bytes: ...
66
+ def sign(
67
+ self,
68
+ signature_algorithm: RSASignatureAlgorithm,
69
+ digest: bytes | bytearray | memoryview,
70
+ ) -> bytes: ...
71
+ def verify(
72
+ self,
73
+ signature_algorithm: RSASignatureAlgorithm,
74
+ digest: bytes | bytearray | memoryview,
75
+ signature: bytes | bytearray | memoryview,
76
+ ) -> bool: ...
77
+
78
+ class ED25519ExportFormat(IntEnum):
79
+ RAW = 0
80
+ OPENSSH_B64 = 1
81
+
82
+ class ED25519(NativeResource):
83
+ def __init__(self, binding: Any) -> None: ...
84
+ @staticmethod
85
+ def new_generate() -> ED25519: ...
86
+ def export_public_key(self, export_format: ED25519ExportFormat) -> bytes: ...
87
+ def export_private_key(self, export_format: ED25519ExportFormat) -> bytes: ...
88
+
89
+ class ECType(IntEnum):
90
+ P_256 = 0
91
+ P_384 = 1
92
+
93
+ class ECExportFormat(IntEnum):
94
+ SEC1 = 0
95
+ PKCS8 = 1
96
+ SPKI = 2
97
+
98
+ class ECRawSignature(NamedTuple):
99
+ r: bytes
100
+ s: bytes
101
+
102
+ class ECPublicCoords(NamedTuple):
103
+ x: bytes
104
+ y: bytes
105
+
106
+ class EC(NativeResource):
107
+ def __init__(self, binding: Any) -> None: ...
108
+ @staticmethod
109
+ def new_generate(type: ECType) -> EC: ...
110
+ @staticmethod
111
+ def new_key_from_der_data(der_data: bytes | bytearray | memoryview) -> EC: ...
112
+ @staticmethod
113
+ def decode_der_signature(signature: bytes) -> ECRawSignature: ...
114
+ @staticmethod
115
+ def encode_raw_signature(signature: ECRawSignature) -> bytes: ...
116
+ def export_key(self, export_format: ECExportFormat) -> bytes: ...
117
+ def get_public_coords(self) -> ECPublicCoords: ...
118
+ def sign(self, digest: bytes | bytearray | memoryview) -> bytes: ...
119
+ def verify(
120
+ self, digest: bytes | bytearray | memoryview, signature: bytes | bytearray | memoryview
121
+ ) -> bool: ...
@@ -0,0 +1,60 @@
1
+ """
2
+ Type annotations for awscrt.eventstream module.
3
+
4
+ Copyright 2024 Vlad Emelianov
5
+ """
6
+
7
+ from enum import IntEnum
8
+ from typing import Any
9
+ from uuid import UUID
10
+
11
+ __all__ = ["Header", "HeaderType"]
12
+
13
+ class HeaderType(IntEnum):
14
+ BOOL_TRUE = 0
15
+ BOOL_FALSE = 1
16
+ BYTE = 2
17
+ INT16 = 3
18
+ INT32 = 4
19
+ INT64 = 5
20
+ BYTE_BUF = 6
21
+ STRING = 7
22
+ TIMESTAMP = 8
23
+ UUID = 9
24
+ def __format__(self, format_spec: str) -> str: ...
25
+
26
+ class Header:
27
+ def __init__(self, name: str, value: Any, header_type: HeaderType) -> None: ...
28
+ @classmethod
29
+ def from_bool(cls, name: str, value: bool) -> Header: ...
30
+ @classmethod
31
+ def from_byte(cls, name: str, value: int) -> Header: ...
32
+ @classmethod
33
+ def from_int16(cls, name: str, value: int) -> Header: ...
34
+ @classmethod
35
+ def from_int32(cls, name: str, value: int) -> Header: ...
36
+ @classmethod
37
+ def from_int64(cls, name: str, value: int) -> Header: ...
38
+ @classmethod
39
+ def from_byte_buf(cls, name: str, value: bytes | bytearray) -> Header: ...
40
+ @classmethod
41
+ def from_string(cls, name: str, value: str) -> Header: ...
42
+ @classmethod
43
+ def from_timestamp(cls, name: str, value: int) -> Header: ...
44
+ @classmethod
45
+ def from_uuid(cls, name: str, value: UUID) -> Header: ...
46
+ @property
47
+ def name(self) -> str: ...
48
+ @property
49
+ def type(self) -> HeaderType: ...
50
+ @property
51
+ def value(self) -> Any: ...
52
+ def value_as_bool(self) -> bool: ...
53
+ def value_as_byte(self) -> int: ...
54
+ def value_as_int16(self) -> int: ...
55
+ def value_as_int32(self) -> int: ...
56
+ def value_as_int64(self) -> int: ...
57
+ def value_as_byte_buf(self) -> bytes | bytearray: ...
58
+ def value_as_string(self) -> str: ...
59
+ def value_as_timestamp(self) -> int: ...
60
+ def value_as_uuid(self) -> UUID: ...