SuperRealCo commited on
Commit
ac994de
·
verified ·
1 Parent(s): 7a26217

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +11 -0
  2. venv/bin/deepspeed.pt +3 -0
  3. venv/bin/ninja +3 -0
  4. venv/bin/python +3 -0
  5. venv/bin/python3 +3 -0
  6. venv/bin/python3.10 +3 -0
  7. venv/bin/uvx +3 -0
  8. venv/insightface/data/images/t1.jpg +3 -0
  9. venv/insightface/data/objects/meanshape_68.pkl +3 -0
  10. venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/INSTALLER +1 -0
  11. venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/LICENSE.rst +21 -0
  12. venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/METADATA +195 -0
  13. venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/RECORD +12 -0
  14. venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/WHEEL +6 -0
  15. venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/top_level.txt +1 -0
  16. venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so +3 -0
  17. venv/lib/python3.10/site-packages/coloredlogs.pth +3 -0
  18. venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/INSTALLER +1 -0
  19. venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/METADATA +139 -0
  20. venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/licenses/LICENSE +3 -0
  21. venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/licenses/LICENSE.BSD +27 -0
  22. venv/lib/python3.10/site-packages/cryptography/__about__.py +17 -0
  23. venv/lib/python3.10/site-packages/cryptography/__init__.py +26 -0
  24. venv/lib/python3.10/site-packages/cryptography/__pycache__/__about__.cpython-310.pyc +0 -0
  25. venv/lib/python3.10/site-packages/cryptography/__pycache__/__init__.cpython-310.pyc +0 -0
  26. venv/lib/python3.10/site-packages/cryptography/__pycache__/exceptions.cpython-310.pyc +0 -0
  27. venv/lib/python3.10/site-packages/cryptography/__pycache__/fernet.cpython-310.pyc +0 -0
  28. venv/lib/python3.10/site-packages/cryptography/__pycache__/utils.cpython-310.pyc +0 -0
  29. venv/lib/python3.10/site-packages/cryptography/exceptions.py +52 -0
  30. venv/lib/python3.10/site-packages/cryptography/fernet.py +224 -0
  31. venv/lib/python3.10/site-packages/cryptography/hazmat/__init__.py +13 -0
  32. venv/lib/python3.10/site-packages/cryptography/hazmat/__pycache__/__init__.cpython-310.pyc +0 -0
  33. venv/lib/python3.10/site-packages/cryptography/hazmat/__pycache__/_oid.cpython-310.pyc +0 -0
  34. venv/lib/python3.10/site-packages/cryptography/hazmat/_oid.py +348 -0
  35. venv/lib/python3.10/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
  36. venv/lib/python3.10/site-packages/cryptography/hazmat/backends/__pycache__/__init__.cpython-310.pyc +0 -0
  37. venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
  38. venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/__pycache__/__init__.cpython-310.pyc +0 -0
  39. venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/__pycache__/backend.cpython-310.pyc +0 -0
  40. venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
  41. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
  42. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/__pycache__/__init__.cpython-310.pyc +0 -0
  43. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +3 -0
  44. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
  45. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
  46. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
  47. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
  48. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
  49. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
  50. venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
.gitattributes CHANGED
@@ -53,3 +53,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+ venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
57
+ venv/lib/python3.10/site-packages/simsimd.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
58
+ venv/lib/python3.10/site-packages/rich/__pycache__/_emoji_codes.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
59
+ venv/lib/python3.10/site-packages/stringzilla.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
60
+ venv/bin/python3 filter=lfs diff=lfs merge=lfs -text
61
+ venv/bin/ninja filter=lfs diff=lfs merge=lfs -text
62
+ venv/lib/python3.10/site-packages/github/__pycache__/Repository.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
63
+ venv/bin/uvx filter=lfs diff=lfs merge=lfs -text
64
+ venv/bin/python filter=lfs diff=lfs merge=lfs -text
65
+ venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust.abi3.so filter=lfs diff=lfs merge=lfs -text
66
+ venv/bin/python3.10 filter=lfs diff=lfs merge=lfs -text
venv/bin/deepspeed.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d5bc66cee1ff65f80ad49f921cfb3746fe89f3edc000891eb3a7820c8703f4c
3
+ size 120
venv/bin/ninja ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94f5318756260447ffb88d0bc31b67dbc07119f1dc0c8dc2cb58ea575a471025
3
+ size 1085448
venv/bin/python ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45692c3da2492563eabf0a8f5dc18d20dc9c34ffe3a18202563e00bae684be91
3
+ size 5904904
venv/bin/python3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45692c3da2492563eabf0a8f5dc18d20dc9c34ffe3a18202563e00bae684be91
3
+ size 5904904
venv/bin/python3.10 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45692c3da2492563eabf0a8f5dc18d20dc9c34ffe3a18202563e00bae684be91
3
+ size 5904904
venv/bin/uvx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a119bc8313764e6cba793788e1c11b84e8c32e59c20dcd4d57aff71b07512694
3
+ size 361008
venv/insightface/data/images/t1.jpg ADDED

Git LFS Details

  • SHA256: 47f682e945b659f93a9e490b9c9c4a2a864abe64dace9e1a2893845ddfd69489
  • Pointer size: 131 Bytes
  • Size of remote file: 129 kB
venv/insightface/data/objects/meanshape_68.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39ffecf84ba73f0d0d7e49380833ba88713c9fcdec51df4f7ac45a48b8f4cc51
3
+ size 974
venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/LICENSE.rst ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Laurent LAPORTE
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/METADATA ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.2
2
+ Name: Deprecated
3
+ Version: 1.2.18
4
+ Summary: Python @deprecated decorator to deprecate old python classes, functions or methods.
5
+ Home-page: https://github.com/laurent-laporte-pro/deprecated
6
+ Author: Laurent LAPORTE
7
+ Author-email: laurent.laporte.pro@gmail.com
8
+ License: MIT
9
+ Project-URL: Documentation, https://deprecated.readthedocs.io/en/latest/
10
+ Project-URL: Source, https://github.com/laurent-laporte-pro/deprecated
11
+ Project-URL: Bug Tracker, https://github.com/laurent-laporte-pro/deprecated/issues
12
+ Keywords: deprecate,deprecated,deprecation,warning,warn,decorator
13
+ Platform: any
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Environment :: Web Environment
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python
20
+ Classifier: Programming Language :: Python :: 2
21
+ Classifier: Programming Language :: Python :: 2.7
22
+ Classifier: Programming Language :: Python :: 3
23
+ Classifier: Programming Language :: Python :: 3.4
24
+ Classifier: Programming Language :: Python :: 3.5
25
+ Classifier: Programming Language :: Python :: 3.6
26
+ Classifier: Programming Language :: Python :: 3.7
27
+ Classifier: Programming Language :: Python :: 3.8
28
+ Classifier: Programming Language :: Python :: 3.9
29
+ Classifier: Programming Language :: Python :: 3.10
30
+ Classifier: Programming Language :: Python :: 3.11
31
+ Classifier: Programming Language :: Python :: 3.12
32
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
+ Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
34
+ Description-Content-Type: text/x-rst
35
+ License-File: LICENSE.rst
36
+ Requires-Dist: wrapt<2,>=1.10
37
+ Provides-Extra: dev
38
+ Requires-Dist: tox; extra == "dev"
39
+ Requires-Dist: PyTest; extra == "dev"
40
+ Requires-Dist: PyTest-Cov; extra == "dev"
41
+ Requires-Dist: bump2version<1; extra == "dev"
42
+ Requires-Dist: setuptools; python_version >= "3.12" and extra == "dev"
43
+ Dynamic: author
44
+ Dynamic: author-email
45
+ Dynamic: classifier
46
+ Dynamic: description
47
+ Dynamic: description-content-type
48
+ Dynamic: home-page
49
+ Dynamic: keywords
50
+ Dynamic: license
51
+ Dynamic: platform
52
+ Dynamic: project-url
53
+ Dynamic: provides-extra
54
+ Dynamic: requires-dist
55
+ Dynamic: requires-python
56
+ Dynamic: summary
57
+
58
+
59
+ Deprecated Library
60
+ ------------------
61
+
62
+ Deprecated is Easy to Use
63
+ `````````````````````````
64
+
65
+ If you need to mark a function or a method as deprecated,
66
+ you can use the ``@deprecated`` decorator:
67
+
68
+ Save in a hello.py:
69
+
70
+ .. code:: python
71
+
72
+ from deprecated import deprecated
73
+
74
+
75
+ @deprecated(version='1.2.1', reason="You should use another function")
76
+ def some_old_function(x, y):
77
+ return x + y
78
+
79
+
80
+ class SomeClass(object):
81
+ @deprecated(version='1.3.0', reason="This method is deprecated")
82
+ def some_old_method(self, x, y):
83
+ return x + y
84
+
85
+
86
+ some_old_function(12, 34)
87
+ obj = SomeClass()
88
+ obj.some_old_method(5, 8)
89
+
90
+
91
+ And Easy to Setup
92
+ `````````````````
93
+
94
+ And run it:
95
+
96
+ .. code:: bash
97
+
98
+ $ pip install Deprecated
99
+ $ python hello.py
100
+ hello.py:15: DeprecationWarning: Call to deprecated function (or staticmethod) some_old_function.
101
+ (You should use another function) -- Deprecated since version 1.2.0.
102
+ some_old_function(12, 34)
103
+ hello.py:17: DeprecationWarning: Call to deprecated method some_old_method.
104
+ (This method is deprecated) -- Deprecated since version 1.3.0.
105
+ obj.some_old_method(5, 8)
106
+
107
+
108
+ You can document your code
109
+ ``````````````````````````
110
+
111
+ Have you ever wonder how to document that some functions, classes, methods, etc. are deprecated?
112
+ This is now possible with the integrated Sphinx directives:
113
+
114
+ For instance, in hello_sphinx.py:
115
+
116
+ .. code:: python
117
+
118
+ from deprecated.sphinx import deprecated
119
+ from deprecated.sphinx import versionadded
120
+ from deprecated.sphinx import versionchanged
121
+
122
+
123
+ @versionadded(version='1.0', reason="This function is new")
124
+ def function_one():
125
+ '''This is the function one'''
126
+
127
+
128
+ @versionchanged(version='1.0', reason="This function is modified")
129
+ def function_two():
130
+ '''This is the function two'''
131
+
132
+
133
+ @deprecated(version='1.0', reason="This function will be removed soon")
134
+ def function_three():
135
+ '''This is the function three'''
136
+
137
+
138
+ function_one()
139
+ function_two()
140
+ function_three() # warns
141
+
142
+ help(function_one)
143
+ help(function_two)
144
+ help(function_three)
145
+
146
+
147
+ The result it immediate
148
+ ```````````````````````
149
+
150
+ Run it:
151
+
152
+ .. code:: bash
153
+
154
+ $ python hello_sphinx.py
155
+
156
+ hello_sphinx.py:23: DeprecationWarning: Call to deprecated function (or staticmethod) function_three.
157
+ (This function will be removed soon) -- Deprecated since version 1.0.
158
+ function_three() # warns
159
+
160
+ Help on function function_one in module __main__:
161
+
162
+ function_one()
163
+ This is the function one
164
+
165
+ .. versionadded:: 1.0
166
+ This function is new
167
+
168
+ Help on function function_two in module __main__:
169
+
170
+ function_two()
171
+ This is the function two
172
+
173
+ .. versionchanged:: 1.0
174
+ This function is modified
175
+
176
+ Help on function function_three in module __main__:
177
+
178
+ function_three()
179
+ This is the function three
180
+
181
+ .. deprecated:: 1.0
182
+ This function will be removed soon
183
+
184
+
185
+ Links
186
+ `````
187
+
188
+ * `Python package index (PyPi) <https://pypi.org/project/Deprecated/>`_
189
+ * `GitHub website <https://github.com/laurent-laporte-pro/deprecated>`_
190
+ * `Read The Docs <https://readthedocs.org/projects/deprecated>`_
191
+ * `EBook on Lulu.com <http://www.lulu.com/commerce/index.php?fBuyContent=21305117>`_
192
+ * `StackOverFlow Q&A <https://stackoverflow.com/a/40301488/1513933>`_
193
+ * `Development version
194
+ <https://github.com/laurent-laporte-pro/deprecated/zipball/master#egg=Deprecated-dev>`_
195
+
venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/RECORD ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Deprecated-1.2.18.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ Deprecated-1.2.18.dist-info/LICENSE.rst,sha256=HoPt0VvkGbXVveNy4yXlJ_9PmRX1SOfHUxS0H2aZ6Dw,1081
3
+ Deprecated-1.2.18.dist-info/METADATA,sha256=4CrUw5Bl8_NsBuZYe0Nw-mIwQnVpT1CnmBYU9BqOuq8,5725
4
+ Deprecated-1.2.18.dist-info/RECORD,,
5
+ Deprecated-1.2.18.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
6
+ Deprecated-1.2.18.dist-info/top_level.txt,sha256=nHbOYawKPQQE5lQl-toUB1JBRJjUyn_m_Mb8RVJ0RjA,11
7
+ deprecated/__init__.py,sha256=yZNbmDKXF4PLtp_Ikdb_9ObJLkHuFSUHvqidFTKKGFM,351
8
+ deprecated/__pycache__/__init__.cpython-310.pyc,,
9
+ deprecated/__pycache__/classic.cpython-310.pyc,,
10
+ deprecated/__pycache__/sphinx.cpython-310.pyc,,
11
+ deprecated/classic.py,sha256=7WXOt4Vf1NhrUznm8ypjS50CMyAdZwrGT58Lhb8fW14,10609
12
+ deprecated/sphinx.py,sha256=cOKnXbDyFAwDr5O7HBEpgQrx-J-qfp57sfdK_LabDxs,11109
venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/WHEEL ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.8.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py2-none-any
5
+ Tag: py3-none-any
6
+
venv/lib/python3.10/site-packages/Deprecated-1.2.18.dist-info/top_level.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ deprecated
venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5c8945700e8898906b6ea28b3b822e54d934937811d5a0392778408ccda39b2
3
+ size 985520
venv/lib/python3.10/site-packages/coloredlogs.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dda83a855986efa5cd87f0248b0199c0086eb0e8e7fece7d6741959c5ce39536
3
+ size 147
venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/METADATA ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: cryptography
3
+ Version: 45.0.5
4
+ Classifier: Development Status :: 5 - Production/Stable
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Natural Language :: English
7
+ Classifier: Operating System :: MacOS :: MacOS X
8
+ Classifier: Operating System :: POSIX
9
+ Classifier: Operating System :: POSIX :: BSD
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.7
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: Implementation :: CPython
23
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
24
+ Classifier: Topic :: Security :: Cryptography
25
+ Requires-Dist: cffi>=1.14 ; platform_python_implementation != 'PyPy'
26
+ Requires-Dist: bcrypt>=3.1.5 ; extra == 'ssh'
27
+ Requires-Dist: nox>=2024.4.15 ; extra == 'nox'
28
+ Requires-Dist: nox[uv]>=2024.3.2 ; python_full_version >= '3.8' and extra == 'nox'
29
+ Requires-Dist: cryptography-vectors==45.0.5 ; extra == 'test'
30
+ Requires-Dist: pytest>=7.4.0 ; extra == 'test'
31
+ Requires-Dist: pytest-benchmark>=4.0 ; extra == 'test'
32
+ Requires-Dist: pytest-cov>=2.10.1 ; extra == 'test'
33
+ Requires-Dist: pytest-xdist>=3.5.0 ; extra == 'test'
34
+ Requires-Dist: pretend>=0.7 ; extra == 'test'
35
+ Requires-Dist: certifi>=2024 ; extra == 'test'
36
+ Requires-Dist: pytest-randomly ; extra == 'test-randomorder'
37
+ Requires-Dist: sphinx>=5.3.0 ; extra == 'docs'
38
+ Requires-Dist: sphinx-rtd-theme>=3.0.0 ; python_full_version >= '3.8' and extra == 'docs'
39
+ Requires-Dist: sphinx-inline-tabs ; python_full_version >= '3.8' and extra == 'docs'
40
+ Requires-Dist: pyenchant>=3 ; extra == 'docstest'
41
+ Requires-Dist: readme-renderer>=30.0 ; extra == 'docstest'
42
+ Requires-Dist: sphinxcontrib-spelling>=7.3.1 ; extra == 'docstest'
43
+ Requires-Dist: build>=1.0.0 ; extra == 'sdist'
44
+ Requires-Dist: ruff>=0.3.6 ; extra == 'pep8test'
45
+ Requires-Dist: mypy>=1.4 ; extra == 'pep8test'
46
+ Requires-Dist: check-sdist ; python_full_version >= '3.8' and extra == 'pep8test'
47
+ Requires-Dist: click>=8.0.1 ; extra == 'pep8test'
48
+ Provides-Extra: ssh
49
+ Provides-Extra: nox
50
+ Provides-Extra: test
51
+ Provides-Extra: test-randomorder
52
+ Provides-Extra: docs
53
+ Provides-Extra: docstest
54
+ Provides-Extra: sdist
55
+ Provides-Extra: pep8test
56
+ License-File: LICENSE
57
+ License-File: LICENSE.APACHE
58
+ License-File: LICENSE.BSD
59
+ Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
60
+ Author: The cryptography developers <cryptography-dev@python.org>
61
+ Author-email: The Python Cryptographic Authority and individual contributors <cryptography-dev@python.org>
62
+ License: Apache-2.0 OR BSD-3-Clause
63
+ Requires-Python: >=3.7, !=3.9.0, !=3.9.1
64
+ Description-Content-Type: text/x-rst; charset=UTF-8
65
+ Project-URL: homepage, https://github.com/pyca/cryptography
66
+ Project-URL: documentation, https://cryptography.io/
67
+ Project-URL: source, https://github.com/pyca/cryptography/
68
+ Project-URL: issues, https://github.com/pyca/cryptography/issues
69
+ Project-URL: changelog, https://cryptography.io/en/latest/changelog/
70
+
71
+ pyca/cryptography
72
+ =================
73
+
74
+ .. image:: https://img.shields.io/pypi/v/cryptography.svg
75
+ :target: https://pypi.org/project/cryptography/
76
+ :alt: Latest Version
77
+
78
+ .. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest
79
+ :target: https://cryptography.io
80
+ :alt: Latest Docs
81
+
82
+ .. image:: https://github.com/pyca/cryptography/workflows/CI/badge.svg?branch=main
83
+ :target: https://github.com/pyca/cryptography/actions?query=workflow%3ACI+branch%3Amain
84
+
85
+
86
+ ``cryptography`` is a package which provides cryptographic recipes and
87
+ primitives to Python developers. Our goal is for it to be your "cryptographic
88
+ standard library". It supports Python 3.7+ and PyPy3 7.3.11+.
89
+
90
+ ``cryptography`` includes both high level recipes and low level interfaces to
91
+ common cryptographic algorithms such as symmetric ciphers, message digests, and
92
+ key derivation functions. For example, to encrypt something with
93
+ ``cryptography``'s high level symmetric encryption recipe:
94
+
95
+ .. code-block:: pycon
96
+
97
+ >>> from cryptography.fernet import Fernet
98
+ >>> # Put this somewhere safe!
99
+ >>> key = Fernet.generate_key()
100
+ >>> f = Fernet(key)
101
+ >>> token = f.encrypt(b"A really secret message. Not for prying eyes.")
102
+ >>> token
103
+ b'...'
104
+ >>> f.decrypt(token)
105
+ b'A really secret message. Not for prying eyes.'
106
+
107
+ You can find more information in the `documentation`_.
108
+
109
+ You can install ``cryptography`` with:
110
+
111
+ .. code-block:: console
112
+
113
+ $ pip install cryptography
114
+
115
+ For full details see `the installation documentation`_.
116
+
117
+ Discussion
118
+ ~~~~~~~~~~
119
+
120
+ If you run into bugs, you can file them in our `issue tracker`_.
121
+
122
+ We maintain a `cryptography-dev`_ mailing list for development discussion.
123
+
124
+ You can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get
125
+ involved.
126
+
127
+ Security
128
+ ~~~~~~~~
129
+
130
+ Need to report a security issue? Please consult our `security reporting`_
131
+ documentation.
132
+
133
+
134
+ .. _`documentation`: https://cryptography.io/
135
+ .. _`the installation documentation`: https://cryptography.io/en/latest/installation/
136
+ .. _`issue tracker`: https://github.com/pyca/cryptography/issues
137
+ .. _`cryptography-dev`: https://mail.python.org/mailman/listinfo/cryptography-dev
138
+ .. _`security reporting`: https://cryptography.io/en/latest/security/
139
+
venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/licenses/LICENSE ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ This software is made available under the terms of *either* of the licenses
2
+ found in LICENSE.APACHE or LICENSE.BSD. Contributions to cryptography are made
3
+ under the terms of *both* these licenses.
venv/lib/python3.10/site-packages/cryptography-45.0.5.dist-info/licenses/LICENSE.BSD ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) Individual contributors.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ 3. Neither the name of PyCA Cryptography nor the names of its contributors
15
+ may be used to endorse or promote products derived from this software
16
+ without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
venv/lib/python3.10/site-packages/cryptography/__about__.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ __all__ = [
8
+ "__author__",
9
+ "__copyright__",
10
+ "__version__",
11
+ ]
12
+
13
+ __version__ = "45.0.5"
14
+
15
+
16
+ __author__ = "The Python Cryptographic Authority and individual contributors"
17
+ __copyright__ = f"Copyright 2013-2025 {__author__}"
venv/lib/python3.10/site-packages/cryptography/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import sys
8
+ import warnings
9
+
10
+ from cryptography import utils
11
+ from cryptography.__about__ import __author__, __copyright__, __version__
12
+
13
+ __all__ = [
14
+ "__author__",
15
+ "__copyright__",
16
+ "__version__",
17
+ ]
18
+
19
+ if sys.version_info[:2] == (3, 7):
20
+ warnings.warn(
21
+ "Python 3.7 is no longer supported by the Python core team "
22
+ "and support for it is deprecated in cryptography. The next release "
23
+ "of cryptography will remove support for Python 3.7.",
24
+ utils.CryptographyDeprecationWarning,
25
+ stacklevel=2,
26
+ )
venv/lib/python3.10/site-packages/cryptography/__pycache__/__about__.cpython-310.pyc ADDED
Binary file (411 Bytes). View file
 
venv/lib/python3.10/site-packages/cryptography/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (730 Bytes). View file
 
venv/lib/python3.10/site-packages/cryptography/__pycache__/exceptions.cpython-310.pyc ADDED
Binary file (1.98 kB). View file
 
venv/lib/python3.10/site-packages/cryptography/__pycache__/fernet.cpython-310.pyc ADDED
Binary file (7 kB). View file
 
venv/lib/python3.10/site-packages/cryptography/__pycache__/utils.cpython-310.pyc ADDED
Binary file (4.9 kB). View file
 
venv/lib/python3.10/site-packages/cryptography/exceptions.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+
9
+ from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
10
+
11
+ if typing.TYPE_CHECKING:
12
+ from cryptography.hazmat.bindings._rust import openssl as rust_openssl
13
+
14
+ _Reasons = rust_exceptions._Reasons
15
+
16
+
17
+ class UnsupportedAlgorithm(Exception):
18
+ def __init__(self, message: str, reason: _Reasons | None = None) -> None:
19
+ super().__init__(message)
20
+ self._reason = reason
21
+
22
+
23
+ class AlreadyFinalized(Exception):
24
+ pass
25
+
26
+
27
+ class AlreadyUpdated(Exception):
28
+ pass
29
+
30
+
31
+ class NotYetFinalized(Exception):
32
+ pass
33
+
34
+
35
+ class InvalidTag(Exception):
36
+ pass
37
+
38
+
39
+ class InvalidSignature(Exception):
40
+ pass
41
+
42
+
43
+ class InternalError(Exception):
44
+ def __init__(
45
+ self, msg: str, err_code: list[rust_openssl.OpenSSLError]
46
+ ) -> None:
47
+ super().__init__(msg)
48
+ self.err_code = err_code
49
+
50
+
51
+ class InvalidKey(Exception):
52
+ pass
venv/lib/python3.10/site-packages/cryptography/fernet.py ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import base64
8
+ import binascii
9
+ import os
10
+ import time
11
+ import typing
12
+ from collections.abc import Iterable
13
+
14
+ from cryptography import utils
15
+ from cryptography.exceptions import InvalidSignature
16
+ from cryptography.hazmat.primitives import hashes, padding
17
+ from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
18
+ from cryptography.hazmat.primitives.hmac import HMAC
19
+
20
+
21
+ class InvalidToken(Exception):
22
+ pass
23
+
24
+
25
+ _MAX_CLOCK_SKEW = 60
26
+
27
+
28
+ class Fernet:
29
+ def __init__(
30
+ self,
31
+ key: bytes | str,
32
+ backend: typing.Any = None,
33
+ ) -> None:
34
+ try:
35
+ key = base64.urlsafe_b64decode(key)
36
+ except binascii.Error as exc:
37
+ raise ValueError(
38
+ "Fernet key must be 32 url-safe base64-encoded bytes."
39
+ ) from exc
40
+ if len(key) != 32:
41
+ raise ValueError(
42
+ "Fernet key must be 32 url-safe base64-encoded bytes."
43
+ )
44
+
45
+ self._signing_key = key[:16]
46
+ self._encryption_key = key[16:]
47
+
48
+ @classmethod
49
+ def generate_key(cls) -> bytes:
50
+ return base64.urlsafe_b64encode(os.urandom(32))
51
+
52
+ def encrypt(self, data: bytes) -> bytes:
53
+ return self.encrypt_at_time(data, int(time.time()))
54
+
55
+ def encrypt_at_time(self, data: bytes, current_time: int) -> bytes:
56
+ iv = os.urandom(16)
57
+ return self._encrypt_from_parts(data, current_time, iv)
58
+
59
+ def _encrypt_from_parts(
60
+ self, data: bytes, current_time: int, iv: bytes
61
+ ) -> bytes:
62
+ utils._check_bytes("data", data)
63
+
64
+ padder = padding.PKCS7(algorithms.AES.block_size).padder()
65
+ padded_data = padder.update(data) + padder.finalize()
66
+ encryptor = Cipher(
67
+ algorithms.AES(self._encryption_key),
68
+ modes.CBC(iv),
69
+ ).encryptor()
70
+ ciphertext = encryptor.update(padded_data) + encryptor.finalize()
71
+
72
+ basic_parts = (
73
+ b"\x80"
74
+ + current_time.to_bytes(length=8, byteorder="big")
75
+ + iv
76
+ + ciphertext
77
+ )
78
+
79
+ h = HMAC(self._signing_key, hashes.SHA256())
80
+ h.update(basic_parts)
81
+ hmac = h.finalize()
82
+ return base64.urlsafe_b64encode(basic_parts + hmac)
83
+
84
+ def decrypt(self, token: bytes | str, ttl: int | None = None) -> bytes:
85
+ timestamp, data = Fernet._get_unverified_token_data(token)
86
+ if ttl is None:
87
+ time_info = None
88
+ else:
89
+ time_info = (ttl, int(time.time()))
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)
104
+ # Verify the token was not tampered with.
105
+ self._verify_signature(data)
106
+ return timestamp
107
+
108
+ @staticmethod
109
+ def _get_unverified_token_data(token: bytes | str) -> tuple[int, bytes]:
110
+ if not isinstance(token, (str, bytes)):
111
+ raise TypeError("token must be bytes or str")
112
+
113
+ try:
114
+ data = base64.urlsafe_b64decode(token)
115
+ except (TypeError, binascii.Error):
116
+ raise InvalidToken
117
+
118
+ if not data or data[0] != 0x80:
119
+ raise InvalidToken
120
+
121
+ if len(data) < 9:
122
+ raise InvalidToken
123
+
124
+ timestamp = int.from_bytes(data[1:9], byteorder="big")
125
+ return timestamp, data
126
+
127
+ def _verify_signature(self, data: bytes) -> None:
128
+ h = HMAC(self._signing_key, hashes.SHA256())
129
+ h.update(data[:-32])
130
+ try:
131
+ h.verify(data[-32:])
132
+ except InvalidSignature:
133
+ raise InvalidToken
134
+
135
+ def _decrypt_data(
136
+ self,
137
+ data: bytes,
138
+ timestamp: int,
139
+ time_info: tuple[int, int] | None,
140
+ ) -> bytes:
141
+ if time_info is not None:
142
+ ttl, current_time = time_info
143
+ if timestamp + ttl < current_time:
144
+ raise InvalidToken
145
+
146
+ if current_time + _MAX_CLOCK_SKEW < timestamp:
147
+ raise InvalidToken
148
+
149
+ self._verify_signature(data)
150
+
151
+ iv = data[9:25]
152
+ ciphertext = data[25:-32]
153
+ decryptor = Cipher(
154
+ algorithms.AES(self._encryption_key), modes.CBC(iv)
155
+ ).decryptor()
156
+ plaintext_padded = decryptor.update(ciphertext)
157
+ try:
158
+ plaintext_padded += decryptor.finalize()
159
+ except ValueError:
160
+ raise InvalidToken
161
+ unpadder = padding.PKCS7(algorithms.AES.block_size).unpadder()
162
+
163
+ unpadded = unpadder.update(plaintext_padded)
164
+ try:
165
+ unpadded += unpadder.finalize()
166
+ except ValueError:
167
+ raise InvalidToken
168
+ return unpadded
169
+
170
+
171
+ class MultiFernet:
172
+ def __init__(self, fernets: Iterable[Fernet]):
173
+ fernets = list(fernets)
174
+ if not fernets:
175
+ raise ValueError(
176
+ "MultiFernet requires at least one Fernet instance"
177
+ )
178
+ self._fernets = fernets
179
+
180
+ def encrypt(self, msg: bytes) -> bytes:
181
+ return self.encrypt_at_time(msg, int(time.time()))
182
+
183
+ def encrypt_at_time(self, msg: bytes, current_time: int) -> bytes:
184
+ return self._fernets[0].encrypt_at_time(msg, current_time)
185
+
186
+ def rotate(self, msg: bytes | str) -> bytes:
187
+ timestamp, data = Fernet._get_unverified_token_data(msg)
188
+ for f in self._fernets:
189
+ try:
190
+ p = f._decrypt_data(data, timestamp, None)
191
+ break
192
+ except InvalidToken:
193
+ pass
194
+ else:
195
+ raise InvalidToken
196
+
197
+ iv = os.urandom(16)
198
+ return self._fernets[0]._encrypt_from_parts(p, timestamp, iv)
199
+
200
+ def decrypt(self, msg: bytes | str, ttl: int | None = None) -> bytes:
201
+ for f in self._fernets:
202
+ try:
203
+ return f.decrypt(msg, ttl)
204
+ except InvalidToken:
205
+ pass
206
+ raise InvalidToken
207
+
208
+ def decrypt_at_time(
209
+ self, msg: bytes | str, ttl: int, current_time: int
210
+ ) -> bytes:
211
+ for f in self._fernets:
212
+ try:
213
+ return f.decrypt_at_time(msg, ttl, current_time)
214
+ except InvalidToken:
215
+ pass
216
+ raise InvalidToken
217
+
218
+ def extract_timestamp(self, msg: bytes | str) -> int:
219
+ for f in self._fernets:
220
+ try:
221
+ return f.extract_timestamp(msg)
222
+ except InvalidToken:
223
+ pass
224
+ raise InvalidToken
venv/lib/python3.10/site-packages/cryptography/hazmat/__init__.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ """
8
+ Hazardous Materials
9
+
10
+ This is a "Hazardous Materials" module. You should ONLY use it if you're
11
+ 100% absolutely sure that you know what you're doing because this module
12
+ is full of land mines, dragons, and dinosaurs with laser guns.
13
+ """
venv/lib/python3.10/site-packages/cryptography/hazmat/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (225 Bytes). View file
 
venv/lib/python3.10/site-packages/cryptography/hazmat/__pycache__/_oid.cpython-310.pyc ADDED
Binary file (12.5 kB). View file
 
venv/lib/python3.10/site-packages/cryptography/hazmat/_oid.py ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ from cryptography.hazmat.bindings._rust import (
8
+ ObjectIdentifier as ObjectIdentifier,
9
+ )
10
+ from cryptography.hazmat.primitives import hashes
11
+
12
+
13
+ class ExtensionOID:
14
+ SUBJECT_DIRECTORY_ATTRIBUTES = ObjectIdentifier("2.5.29.9")
15
+ SUBJECT_KEY_IDENTIFIER = ObjectIdentifier("2.5.29.14")
16
+ KEY_USAGE = ObjectIdentifier("2.5.29.15")
17
+ PRIVATE_KEY_USAGE_PERIOD = ObjectIdentifier("2.5.29.16")
18
+ SUBJECT_ALTERNATIVE_NAME = ObjectIdentifier("2.5.29.17")
19
+ ISSUER_ALTERNATIVE_NAME = ObjectIdentifier("2.5.29.18")
20
+ BASIC_CONSTRAINTS = ObjectIdentifier("2.5.29.19")
21
+ NAME_CONSTRAINTS = ObjectIdentifier("2.5.29.30")
22
+ CRL_DISTRIBUTION_POINTS = ObjectIdentifier("2.5.29.31")
23
+ CERTIFICATE_POLICIES = ObjectIdentifier("2.5.29.32")
24
+ POLICY_MAPPINGS = ObjectIdentifier("2.5.29.33")
25
+ AUTHORITY_KEY_IDENTIFIER = ObjectIdentifier("2.5.29.35")
26
+ POLICY_CONSTRAINTS = ObjectIdentifier("2.5.29.36")
27
+ EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37")
28
+ FRESHEST_CRL = ObjectIdentifier("2.5.29.46")
29
+ INHIBIT_ANY_POLICY = ObjectIdentifier("2.5.29.54")
30
+ ISSUING_DISTRIBUTION_POINT = ObjectIdentifier("2.5.29.28")
31
+ AUTHORITY_INFORMATION_ACCESS = ObjectIdentifier("1.3.6.1.5.5.7.1.1")
32
+ SUBJECT_INFORMATION_ACCESS = ObjectIdentifier("1.3.6.1.5.5.7.1.11")
33
+ OCSP_NO_CHECK = ObjectIdentifier("1.3.6.1.5.5.7.48.1.5")
34
+ TLS_FEATURE = ObjectIdentifier("1.3.6.1.5.5.7.1.24")
35
+ CRL_NUMBER = ObjectIdentifier("2.5.29.20")
36
+ DELTA_CRL_INDICATOR = ObjectIdentifier("2.5.29.27")
37
+ PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS = ObjectIdentifier(
38
+ "1.3.6.1.4.1.11129.2.4.2"
39
+ )
40
+ PRECERT_POISON = ObjectIdentifier("1.3.6.1.4.1.11129.2.4.3")
41
+ SIGNED_CERTIFICATE_TIMESTAMPS = ObjectIdentifier("1.3.6.1.4.1.11129.2.4.5")
42
+ MS_CERTIFICATE_TEMPLATE = ObjectIdentifier("1.3.6.1.4.1.311.21.7")
43
+ ADMISSIONS = ObjectIdentifier("1.3.36.8.3.3")
44
+
45
+
46
+ class OCSPExtensionOID:
47
+ NONCE = ObjectIdentifier("1.3.6.1.5.5.7.48.1.2")
48
+ ACCEPTABLE_RESPONSES = ObjectIdentifier("1.3.6.1.5.5.7.48.1.4")
49
+
50
+
51
+ class CRLEntryExtensionOID:
52
+ CERTIFICATE_ISSUER = ObjectIdentifier("2.5.29.29")
53
+ CRL_REASON = ObjectIdentifier("2.5.29.21")
54
+ INVALIDITY_DATE = ObjectIdentifier("2.5.29.24")
55
+
56
+
57
+ class NameOID:
58
+ COMMON_NAME = ObjectIdentifier("2.5.4.3")
59
+ COUNTRY_NAME = ObjectIdentifier("2.5.4.6")
60
+ LOCALITY_NAME = ObjectIdentifier("2.5.4.7")
61
+ STATE_OR_PROVINCE_NAME = ObjectIdentifier("2.5.4.8")
62
+ STREET_ADDRESS = ObjectIdentifier("2.5.4.9")
63
+ ORGANIZATION_IDENTIFIER = ObjectIdentifier("2.5.4.97")
64
+ ORGANIZATION_NAME = ObjectIdentifier("2.5.4.10")
65
+ ORGANIZATIONAL_UNIT_NAME = ObjectIdentifier("2.5.4.11")
66
+ SERIAL_NUMBER = ObjectIdentifier("2.5.4.5")
67
+ SURNAME = ObjectIdentifier("2.5.4.4")
68
+ GIVEN_NAME = ObjectIdentifier("2.5.4.42")
69
+ TITLE = ObjectIdentifier("2.5.4.12")
70
+ INITIALS = ObjectIdentifier("2.5.4.43")
71
+ GENERATION_QUALIFIER = ObjectIdentifier("2.5.4.44")
72
+ X500_UNIQUE_IDENTIFIER = ObjectIdentifier("2.5.4.45")
73
+ DN_QUALIFIER = ObjectIdentifier("2.5.4.46")
74
+ PSEUDONYM = ObjectIdentifier("2.5.4.65")
75
+ USER_ID = ObjectIdentifier("0.9.2342.19200300.100.1.1")
76
+ DOMAIN_COMPONENT = ObjectIdentifier("0.9.2342.19200300.100.1.25")
77
+ EMAIL_ADDRESS = ObjectIdentifier("1.2.840.113549.1.9.1")
78
+ JURISDICTION_COUNTRY_NAME = ObjectIdentifier("1.3.6.1.4.1.311.60.2.1.3")
79
+ JURISDICTION_LOCALITY_NAME = ObjectIdentifier("1.3.6.1.4.1.311.60.2.1.1")
80
+ JURISDICTION_STATE_OR_PROVINCE_NAME = ObjectIdentifier(
81
+ "1.3.6.1.4.1.311.60.2.1.2"
82
+ )
83
+ BUSINESS_CATEGORY = ObjectIdentifier("2.5.4.15")
84
+ POSTAL_ADDRESS = ObjectIdentifier("2.5.4.16")
85
+ POSTAL_CODE = ObjectIdentifier("2.5.4.17")
86
+ INN = ObjectIdentifier("1.2.643.3.131.1.1")
87
+ OGRN = ObjectIdentifier("1.2.643.100.1")
88
+ SNILS = ObjectIdentifier("1.2.643.100.3")
89
+ UNSTRUCTURED_NAME = ObjectIdentifier("1.2.840.113549.1.9.2")
90
+
91
+
92
+ class SignatureAlgorithmOID:
93
+ RSA_WITH_MD5 = ObjectIdentifier("1.2.840.113549.1.1.4")
94
+ RSA_WITH_SHA1 = ObjectIdentifier("1.2.840.113549.1.1.5")
95
+ # This is an alternate OID for RSA with SHA1 that is occasionally seen
96
+ _RSA_WITH_SHA1 = ObjectIdentifier("1.3.14.3.2.29")
97
+ RSA_WITH_SHA224 = ObjectIdentifier("1.2.840.113549.1.1.14")
98
+ RSA_WITH_SHA256 = ObjectIdentifier("1.2.840.113549.1.1.11")
99
+ RSA_WITH_SHA384 = ObjectIdentifier("1.2.840.113549.1.1.12")
100
+ RSA_WITH_SHA512 = ObjectIdentifier("1.2.840.113549.1.1.13")
101
+ RSA_WITH_SHA3_224 = ObjectIdentifier("2.16.840.1.101.3.4.3.13")
102
+ RSA_WITH_SHA3_256 = ObjectIdentifier("2.16.840.1.101.3.4.3.14")
103
+ RSA_WITH_SHA3_384 = ObjectIdentifier("2.16.840.1.101.3.4.3.15")
104
+ RSA_WITH_SHA3_512 = ObjectIdentifier("2.16.840.1.101.3.4.3.16")
105
+ RSASSA_PSS = ObjectIdentifier("1.2.840.113549.1.1.10")
106
+ ECDSA_WITH_SHA1 = ObjectIdentifier("1.2.840.10045.4.1")
107
+ ECDSA_WITH_SHA224 = ObjectIdentifier("1.2.840.10045.4.3.1")
108
+ ECDSA_WITH_SHA256 = ObjectIdentifier("1.2.840.10045.4.3.2")
109
+ ECDSA_WITH_SHA384 = ObjectIdentifier("1.2.840.10045.4.3.3")
110
+ ECDSA_WITH_SHA512 = ObjectIdentifier("1.2.840.10045.4.3.4")
111
+ ECDSA_WITH_SHA3_224 = ObjectIdentifier("2.16.840.1.101.3.4.3.9")
112
+ ECDSA_WITH_SHA3_256 = ObjectIdentifier("2.16.840.1.101.3.4.3.10")
113
+ ECDSA_WITH_SHA3_384 = ObjectIdentifier("2.16.840.1.101.3.4.3.11")
114
+ ECDSA_WITH_SHA3_512 = ObjectIdentifier("2.16.840.1.101.3.4.3.12")
115
+ DSA_WITH_SHA1 = ObjectIdentifier("1.2.840.10040.4.3")
116
+ DSA_WITH_SHA224 = ObjectIdentifier("2.16.840.1.101.3.4.3.1")
117
+ DSA_WITH_SHA256 = ObjectIdentifier("2.16.840.1.101.3.4.3.2")
118
+ DSA_WITH_SHA384 = ObjectIdentifier("2.16.840.1.101.3.4.3.3")
119
+ DSA_WITH_SHA512 = ObjectIdentifier("2.16.840.1.101.3.4.3.4")
120
+ ED25519 = ObjectIdentifier("1.3.101.112")
121
+ ED448 = ObjectIdentifier("1.3.101.113")
122
+ GOSTR3411_94_WITH_3410_2001 = ObjectIdentifier("1.2.643.2.2.3")
123
+ GOSTR3410_2012_WITH_3411_2012_256 = ObjectIdentifier("1.2.643.7.1.1.3.2")
124
+ GOSTR3410_2012_WITH_3411_2012_512 = ObjectIdentifier("1.2.643.7.1.1.3.3")
125
+
126
+
127
+ _SIG_OIDS_TO_HASH: dict[ObjectIdentifier, hashes.HashAlgorithm | None] = {
128
+ SignatureAlgorithmOID.RSA_WITH_MD5: hashes.MD5(),
129
+ SignatureAlgorithmOID.RSA_WITH_SHA1: hashes.SHA1(),
130
+ SignatureAlgorithmOID._RSA_WITH_SHA1: hashes.SHA1(),
131
+ SignatureAlgorithmOID.RSA_WITH_SHA224: hashes.SHA224(),
132
+ SignatureAlgorithmOID.RSA_WITH_SHA256: hashes.SHA256(),
133
+ SignatureAlgorithmOID.RSA_WITH_SHA384: hashes.SHA384(),
134
+ SignatureAlgorithmOID.RSA_WITH_SHA512: hashes.SHA512(),
135
+ SignatureAlgorithmOID.RSA_WITH_SHA3_224: hashes.SHA3_224(),
136
+ SignatureAlgorithmOID.RSA_WITH_SHA3_256: hashes.SHA3_256(),
137
+ SignatureAlgorithmOID.RSA_WITH_SHA3_384: hashes.SHA3_384(),
138
+ SignatureAlgorithmOID.RSA_WITH_SHA3_512: hashes.SHA3_512(),
139
+ SignatureAlgorithmOID.ECDSA_WITH_SHA1: hashes.SHA1(),
140
+ SignatureAlgorithmOID.ECDSA_WITH_SHA224: hashes.SHA224(),
141
+ SignatureAlgorithmOID.ECDSA_WITH_SHA256: hashes.SHA256(),
142
+ SignatureAlgorithmOID.ECDSA_WITH_SHA384: hashes.SHA384(),
143
+ SignatureAlgorithmOID.ECDSA_WITH_SHA512: hashes.SHA512(),
144
+ SignatureAlgorithmOID.ECDSA_WITH_SHA3_224: hashes.SHA3_224(),
145
+ SignatureAlgorithmOID.ECDSA_WITH_SHA3_256: hashes.SHA3_256(),
146
+ SignatureAlgorithmOID.ECDSA_WITH_SHA3_384: hashes.SHA3_384(),
147
+ SignatureAlgorithmOID.ECDSA_WITH_SHA3_512: hashes.SHA3_512(),
148
+ SignatureAlgorithmOID.DSA_WITH_SHA1: hashes.SHA1(),
149
+ SignatureAlgorithmOID.DSA_WITH_SHA224: hashes.SHA224(),
150
+ SignatureAlgorithmOID.DSA_WITH_SHA256: hashes.SHA256(),
151
+ SignatureAlgorithmOID.ED25519: None,
152
+ SignatureAlgorithmOID.ED448: None,
153
+ SignatureAlgorithmOID.GOSTR3411_94_WITH_3410_2001: None,
154
+ SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_256: None,
155
+ SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_512: None,
156
+ }
157
+
158
+
159
+ class HashAlgorithmOID:
160
+ SHA1 = ObjectIdentifier("1.3.14.3.2.26")
161
+ SHA224 = ObjectIdentifier("2.16.840.1.101.3.4.2.4")
162
+ SHA256 = ObjectIdentifier("2.16.840.1.101.3.4.2.1")
163
+ SHA384 = ObjectIdentifier("2.16.840.1.101.3.4.2.2")
164
+ SHA512 = ObjectIdentifier("2.16.840.1.101.3.4.2.3")
165
+ SHA3_224 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.224")
166
+ SHA3_256 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.256")
167
+ SHA3_384 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.384")
168
+ SHA3_512 = ObjectIdentifier("1.3.6.1.4.1.37476.3.2.1.99.7.512")
169
+
170
+
171
+ class PublicKeyAlgorithmOID:
172
+ DSA = ObjectIdentifier("1.2.840.10040.4.1")
173
+ EC_PUBLIC_KEY = ObjectIdentifier("1.2.840.10045.2.1")
174
+ RSAES_PKCS1_v1_5 = ObjectIdentifier("1.2.840.113549.1.1.1")
175
+ RSASSA_PSS = ObjectIdentifier("1.2.840.113549.1.1.10")
176
+ X25519 = ObjectIdentifier("1.3.101.110")
177
+ X448 = ObjectIdentifier("1.3.101.111")
178
+ ED25519 = ObjectIdentifier("1.3.101.112")
179
+ ED448 = ObjectIdentifier("1.3.101.113")
180
+
181
+
182
+ class ExtendedKeyUsageOID:
183
+ SERVER_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.1")
184
+ CLIENT_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.2")
185
+ CODE_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.3")
186
+ EMAIL_PROTECTION = ObjectIdentifier("1.3.6.1.5.5.7.3.4")
187
+ TIME_STAMPING = ObjectIdentifier("1.3.6.1.5.5.7.3.8")
188
+ OCSP_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.9")
189
+ ANY_EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37.0")
190
+ SMARTCARD_LOGON = ObjectIdentifier("1.3.6.1.4.1.311.20.2.2")
191
+ KERBEROS_PKINIT_KDC = ObjectIdentifier("1.3.6.1.5.2.3.5")
192
+ IPSEC_IKE = ObjectIdentifier("1.3.6.1.5.5.7.3.17")
193
+ BUNDLE_SECURITY = ObjectIdentifier("1.3.6.1.5.5.7.3.35")
194
+ CERTIFICATE_TRANSPARENCY = ObjectIdentifier("1.3.6.1.4.1.11129.2.4.4")
195
+
196
+
197
+ class OtherNameFormOID:
198
+ PERMANENT_IDENTIFIER = ObjectIdentifier("1.3.6.1.5.5.7.8.3")
199
+ HW_MODULE_NAME = ObjectIdentifier("1.3.6.1.5.5.7.8.4")
200
+ DNS_SRV = ObjectIdentifier("1.3.6.1.5.5.7.8.7")
201
+ NAI_REALM = ObjectIdentifier("1.3.6.1.5.5.7.8.8")
202
+ SMTP_UTF8_MAILBOX = ObjectIdentifier("1.3.6.1.5.5.7.8.9")
203
+ ACP_NODE_NAME = ObjectIdentifier("1.3.6.1.5.5.7.8.10")
204
+ BUNDLE_EID = ObjectIdentifier("1.3.6.1.5.5.7.8.11")
205
+
206
+
207
+ class AuthorityInformationAccessOID:
208
+ CA_ISSUERS = ObjectIdentifier("1.3.6.1.5.5.7.48.2")
209
+ OCSP = ObjectIdentifier("1.3.6.1.5.5.7.48.1")
210
+
211
+
212
+ class SubjectInformationAccessOID:
213
+ CA_REPOSITORY = ObjectIdentifier("1.3.6.1.5.5.7.48.5")
214
+
215
+
216
+ class CertificatePoliciesOID:
217
+ CPS_QUALIFIER = ObjectIdentifier("1.3.6.1.5.5.7.2.1")
218
+ CPS_USER_NOTICE = ObjectIdentifier("1.3.6.1.5.5.7.2.2")
219
+ ANY_POLICY = ObjectIdentifier("2.5.29.32.0")
220
+
221
+
222
+ class AttributeOID:
223
+ CHALLENGE_PASSWORD = ObjectIdentifier("1.2.840.113549.1.9.7")
224
+ UNSTRUCTURED_NAME = ObjectIdentifier("1.2.840.113549.1.9.2")
225
+
226
+
227
+ _OID_NAMES = {
228
+ NameOID.COMMON_NAME: "commonName",
229
+ NameOID.COUNTRY_NAME: "countryName",
230
+ NameOID.LOCALITY_NAME: "localityName",
231
+ NameOID.STATE_OR_PROVINCE_NAME: "stateOrProvinceName",
232
+ NameOID.STREET_ADDRESS: "streetAddress",
233
+ NameOID.ORGANIZATION_NAME: "organizationName",
234
+ NameOID.ORGANIZATIONAL_UNIT_NAME: "organizationalUnitName",
235
+ NameOID.SERIAL_NUMBER: "serialNumber",
236
+ NameOID.SURNAME: "surname",
237
+ NameOID.GIVEN_NAME: "givenName",
238
+ NameOID.TITLE: "title",
239
+ NameOID.GENERATION_QUALIFIER: "generationQualifier",
240
+ NameOID.X500_UNIQUE_IDENTIFIER: "x500UniqueIdentifier",
241
+ NameOID.DN_QUALIFIER: "dnQualifier",
242
+ NameOID.PSEUDONYM: "pseudonym",
243
+ NameOID.USER_ID: "userID",
244
+ NameOID.DOMAIN_COMPONENT: "domainComponent",
245
+ NameOID.EMAIL_ADDRESS: "emailAddress",
246
+ NameOID.JURISDICTION_COUNTRY_NAME: "jurisdictionCountryName",
247
+ NameOID.JURISDICTION_LOCALITY_NAME: "jurisdictionLocalityName",
248
+ NameOID.JURISDICTION_STATE_OR_PROVINCE_NAME: (
249
+ "jurisdictionStateOrProvinceName"
250
+ ),
251
+ NameOID.BUSINESS_CATEGORY: "businessCategory",
252
+ NameOID.POSTAL_ADDRESS: "postalAddress",
253
+ NameOID.POSTAL_CODE: "postalCode",
254
+ NameOID.INN: "INN",
255
+ NameOID.OGRN: "OGRN",
256
+ NameOID.SNILS: "SNILS",
257
+ NameOID.UNSTRUCTURED_NAME: "unstructuredName",
258
+ SignatureAlgorithmOID.RSA_WITH_MD5: "md5WithRSAEncryption",
259
+ SignatureAlgorithmOID.RSA_WITH_SHA1: "sha1WithRSAEncryption",
260
+ SignatureAlgorithmOID.RSA_WITH_SHA224: "sha224WithRSAEncryption",
261
+ SignatureAlgorithmOID.RSA_WITH_SHA256: "sha256WithRSAEncryption",
262
+ SignatureAlgorithmOID.RSA_WITH_SHA384: "sha384WithRSAEncryption",
263
+ SignatureAlgorithmOID.RSA_WITH_SHA512: "sha512WithRSAEncryption",
264
+ SignatureAlgorithmOID.RSASSA_PSS: "rsassaPss",
265
+ SignatureAlgorithmOID.ECDSA_WITH_SHA1: "ecdsa-with-SHA1",
266
+ SignatureAlgorithmOID.ECDSA_WITH_SHA224: "ecdsa-with-SHA224",
267
+ SignatureAlgorithmOID.ECDSA_WITH_SHA256: "ecdsa-with-SHA256",
268
+ SignatureAlgorithmOID.ECDSA_WITH_SHA384: "ecdsa-with-SHA384",
269
+ SignatureAlgorithmOID.ECDSA_WITH_SHA512: "ecdsa-with-SHA512",
270
+ SignatureAlgorithmOID.DSA_WITH_SHA1: "dsa-with-sha1",
271
+ SignatureAlgorithmOID.DSA_WITH_SHA224: "dsa-with-sha224",
272
+ SignatureAlgorithmOID.DSA_WITH_SHA256: "dsa-with-sha256",
273
+ SignatureAlgorithmOID.ED25519: "ed25519",
274
+ SignatureAlgorithmOID.ED448: "ed448",
275
+ SignatureAlgorithmOID.GOSTR3411_94_WITH_3410_2001: (
276
+ "GOST R 34.11-94 with GOST R 34.10-2001"
277
+ ),
278
+ SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_256: (
279
+ "GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)"
280
+ ),
281
+ SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_512: (
282
+ "GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)"
283
+ ),
284
+ HashAlgorithmOID.SHA1: "sha1",
285
+ HashAlgorithmOID.SHA224: "sha224",
286
+ HashAlgorithmOID.SHA256: "sha256",
287
+ HashAlgorithmOID.SHA384: "sha384",
288
+ HashAlgorithmOID.SHA512: "sha512",
289
+ HashAlgorithmOID.SHA3_224: "sha3_224",
290
+ HashAlgorithmOID.SHA3_256: "sha3_256",
291
+ HashAlgorithmOID.SHA3_384: "sha3_384",
292
+ HashAlgorithmOID.SHA3_512: "sha3_512",
293
+ PublicKeyAlgorithmOID.DSA: "dsaEncryption",
294
+ PublicKeyAlgorithmOID.EC_PUBLIC_KEY: "id-ecPublicKey",
295
+ PublicKeyAlgorithmOID.RSAES_PKCS1_v1_5: "rsaEncryption",
296
+ PublicKeyAlgorithmOID.X25519: "X25519",
297
+ PublicKeyAlgorithmOID.X448: "X448",
298
+ ExtendedKeyUsageOID.SERVER_AUTH: "serverAuth",
299
+ ExtendedKeyUsageOID.CLIENT_AUTH: "clientAuth",
300
+ ExtendedKeyUsageOID.CODE_SIGNING: "codeSigning",
301
+ ExtendedKeyUsageOID.EMAIL_PROTECTION: "emailProtection",
302
+ ExtendedKeyUsageOID.TIME_STAMPING: "timeStamping",
303
+ ExtendedKeyUsageOID.OCSP_SIGNING: "OCSPSigning",
304
+ ExtendedKeyUsageOID.SMARTCARD_LOGON: "msSmartcardLogin",
305
+ ExtendedKeyUsageOID.KERBEROS_PKINIT_KDC: "pkInitKDC",
306
+ ExtensionOID.SUBJECT_DIRECTORY_ATTRIBUTES: "subjectDirectoryAttributes",
307
+ ExtensionOID.SUBJECT_KEY_IDENTIFIER: "subjectKeyIdentifier",
308
+ ExtensionOID.KEY_USAGE: "keyUsage",
309
+ ExtensionOID.PRIVATE_KEY_USAGE_PERIOD: "privateKeyUsagePeriod",
310
+ ExtensionOID.SUBJECT_ALTERNATIVE_NAME: "subjectAltName",
311
+ ExtensionOID.ISSUER_ALTERNATIVE_NAME: "issuerAltName",
312
+ ExtensionOID.BASIC_CONSTRAINTS: "basicConstraints",
313
+ ExtensionOID.PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS: (
314
+ "signedCertificateTimestampList"
315
+ ),
316
+ ExtensionOID.SIGNED_CERTIFICATE_TIMESTAMPS: (
317
+ "signedCertificateTimestampList"
318
+ ),
319
+ ExtensionOID.PRECERT_POISON: "ctPoison",
320
+ ExtensionOID.MS_CERTIFICATE_TEMPLATE: "msCertificateTemplate",
321
+ ExtensionOID.ADMISSIONS: "Admissions",
322
+ CRLEntryExtensionOID.CRL_REASON: "cRLReason",
323
+ CRLEntryExtensionOID.INVALIDITY_DATE: "invalidityDate",
324
+ CRLEntryExtensionOID.CERTIFICATE_ISSUER: "certificateIssuer",
325
+ ExtensionOID.NAME_CONSTRAINTS: "nameConstraints",
326
+ ExtensionOID.CRL_DISTRIBUTION_POINTS: "cRLDistributionPoints",
327
+ ExtensionOID.CERTIFICATE_POLICIES: "certificatePolicies",
328
+ ExtensionOID.POLICY_MAPPINGS: "policyMappings",
329
+ ExtensionOID.AUTHORITY_KEY_IDENTIFIER: "authorityKeyIdentifier",
330
+ ExtensionOID.POLICY_CONSTRAINTS: "policyConstraints",
331
+ ExtensionOID.EXTENDED_KEY_USAGE: "extendedKeyUsage",
332
+ ExtensionOID.FRESHEST_CRL: "freshestCRL",
333
+ ExtensionOID.INHIBIT_ANY_POLICY: "inhibitAnyPolicy",
334
+ ExtensionOID.ISSUING_DISTRIBUTION_POINT: "issuingDistributionPoint",
335
+ ExtensionOID.AUTHORITY_INFORMATION_ACCESS: "authorityInfoAccess",
336
+ ExtensionOID.SUBJECT_INFORMATION_ACCESS: "subjectInfoAccess",
337
+ ExtensionOID.OCSP_NO_CHECK: "OCSPNoCheck",
338
+ ExtensionOID.CRL_NUMBER: "cRLNumber",
339
+ ExtensionOID.DELTA_CRL_INDICATOR: "deltaCRLIndicator",
340
+ ExtensionOID.TLS_FEATURE: "TLSFeature",
341
+ AuthorityInformationAccessOID.OCSP: "OCSP",
342
+ AuthorityInformationAccessOID.CA_ISSUERS: "caIssuers",
343
+ SubjectInformationAccessOID.CA_REPOSITORY: "caRepository",
344
+ CertificatePoliciesOID.CPS_QUALIFIER: "id-qt-cps",
345
+ CertificatePoliciesOID.CPS_USER_NOTICE: "id-qt-unotice",
346
+ OCSPExtensionOID.NONCE: "OCSPNonce",
347
+ AttributeOID.CHALLENGE_PASSWORD: "challengePassword",
348
+ }
venv/lib/python3.10/site-packages/cryptography/hazmat/backends/__init__.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ from typing import Any
8
+
9
+
10
+ def default_backend() -> Any:
11
+ from cryptography.hazmat.backends.openssl.backend import backend
12
+
13
+ return backend
venv/lib/python3.10/site-packages/cryptography/hazmat/backends/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (481 Bytes). View file
 
venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/__init__.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ from cryptography.hazmat.backends.openssl.backend import backend
8
+
9
+ __all__ = ["backend"]
venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (338 Bytes). View file
 
venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/__pycache__/backend.cpython-310.pyc ADDED
Binary file (8.81 kB). View file
 
venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/backend.py ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ from cryptography.hazmat.bindings._rust import openssl as rust_openssl
8
+ from cryptography.hazmat.bindings.openssl import binding
9
+ from cryptography.hazmat.primitives import hashes
10
+ from cryptography.hazmat.primitives._asymmetric import AsymmetricPadding
11
+ from cryptography.hazmat.primitives.asymmetric import ec
12
+ from cryptography.hazmat.primitives.asymmetric import utils as asym_utils
13
+ from cryptography.hazmat.primitives.asymmetric.padding import (
14
+ MGF1,
15
+ OAEP,
16
+ PSS,
17
+ PKCS1v15,
18
+ )
19
+ from cryptography.hazmat.primitives.ciphers import (
20
+ CipherAlgorithm,
21
+ )
22
+ from cryptography.hazmat.primitives.ciphers.algorithms import (
23
+ AES,
24
+ )
25
+ from cryptography.hazmat.primitives.ciphers.modes import (
26
+ CBC,
27
+ Mode,
28
+ )
29
+
30
+
31
+ class Backend:
32
+ """
33
+ OpenSSL API binding interfaces.
34
+ """
35
+
36
+ name = "openssl"
37
+
38
+ # TripleDES encryption is disallowed/deprecated throughout 2023 in
39
+ # FIPS 140-3. To keep it simple we denylist any use of TripleDES (TDEA).
40
+ _fips_ciphers = (AES,)
41
+ # Sometimes SHA1 is still permissible. That logic is contained
42
+ # within the various *_supported methods.
43
+ _fips_hashes = (
44
+ hashes.SHA224,
45
+ hashes.SHA256,
46
+ hashes.SHA384,
47
+ hashes.SHA512,
48
+ hashes.SHA512_224,
49
+ hashes.SHA512_256,
50
+ hashes.SHA3_224,
51
+ hashes.SHA3_256,
52
+ hashes.SHA3_384,
53
+ hashes.SHA3_512,
54
+ hashes.SHAKE128,
55
+ hashes.SHAKE256,
56
+ )
57
+ _fips_ecdh_curves = (
58
+ ec.SECP224R1,
59
+ ec.SECP256R1,
60
+ ec.SECP384R1,
61
+ ec.SECP521R1,
62
+ )
63
+ _fips_rsa_min_key_size = 2048
64
+ _fips_rsa_min_public_exponent = 65537
65
+ _fips_dsa_min_modulus = 1 << 2048
66
+ _fips_dh_min_key_size = 2048
67
+ _fips_dh_min_modulus = 1 << _fips_dh_min_key_size
68
+
69
+ def __init__(self) -> None:
70
+ self._binding = binding.Binding()
71
+ self._ffi = self._binding.ffi
72
+ self._lib = self._binding.lib
73
+ self._fips_enabled = rust_openssl.is_fips_enabled()
74
+
75
+ def __repr__(self) -> str:
76
+ return (
77
+ f"<OpenSSLBackend(version: {self.openssl_version_text()}, "
78
+ f"FIPS: {self._fips_enabled}, "
79
+ f"Legacy: {rust_openssl._legacy_provider_loaded})>"
80
+ )
81
+
82
+ def openssl_assert(self, ok: bool) -> None:
83
+ return binding._openssl_assert(ok)
84
+
85
+ def _enable_fips(self) -> None:
86
+ # This function enables FIPS mode for OpenSSL 3.0.0 on installs that
87
+ # have the FIPS provider installed properly.
88
+ rust_openssl.enable_fips(rust_openssl._providers)
89
+ assert rust_openssl.is_fips_enabled()
90
+ self._fips_enabled = rust_openssl.is_fips_enabled()
91
+
92
+ def openssl_version_text(self) -> str:
93
+ """
94
+ Friendly string name of the loaded OpenSSL library. This is not
95
+ necessarily the same version as it was compiled against.
96
+
97
+ Example: OpenSSL 3.2.1 30 Jan 2024
98
+ """
99
+ return rust_openssl.openssl_version_text()
100
+
101
+ def openssl_version_number(self) -> int:
102
+ return rust_openssl.openssl_version()
103
+
104
+ def hash_supported(self, algorithm: hashes.HashAlgorithm) -> bool:
105
+ if self._fips_enabled and not isinstance(algorithm, self._fips_hashes):
106
+ return False
107
+
108
+ return rust_openssl.hashes.hash_supported(algorithm)
109
+
110
+ def signature_hash_supported(
111
+ self, algorithm: hashes.HashAlgorithm
112
+ ) -> bool:
113
+ # Dedicated check for hashing algorithm use in message digest for
114
+ # signatures, e.g. RSA PKCS#1 v1.5 SHA1 (sha1WithRSAEncryption).
115
+ if self._fips_enabled and isinstance(algorithm, hashes.SHA1):
116
+ return False
117
+ return self.hash_supported(algorithm)
118
+
119
+ def scrypt_supported(self) -> bool:
120
+ if self._fips_enabled:
121
+ return False
122
+ else:
123
+ return hasattr(rust_openssl.kdf.Scrypt, "derive")
124
+
125
+ def argon2_supported(self) -> bool:
126
+ if self._fips_enabled:
127
+ return False
128
+ else:
129
+ return hasattr(rust_openssl.kdf.Argon2id, "derive")
130
+
131
+ def hmac_supported(self, algorithm: hashes.HashAlgorithm) -> bool:
132
+ # FIPS mode still allows SHA1 for HMAC
133
+ if self._fips_enabled and isinstance(algorithm, hashes.SHA1):
134
+ return True
135
+ if rust_openssl.CRYPTOGRAPHY_IS_AWSLC:
136
+ return isinstance(
137
+ algorithm,
138
+ (
139
+ hashes.SHA1,
140
+ hashes.SHA224,
141
+ hashes.SHA256,
142
+ hashes.SHA384,
143
+ hashes.SHA512,
144
+ hashes.SHA512_224,
145
+ hashes.SHA512_256,
146
+ ),
147
+ )
148
+ return self.hash_supported(algorithm)
149
+
150
+ def cipher_supported(self, cipher: CipherAlgorithm, mode: Mode) -> bool:
151
+ if self._fips_enabled:
152
+ # FIPS mode requires AES. TripleDES is disallowed/deprecated in
153
+ # FIPS 140-3.
154
+ if not isinstance(cipher, self._fips_ciphers):
155
+ return False
156
+
157
+ return rust_openssl.ciphers.cipher_supported(cipher, mode)
158
+
159
+ def pbkdf2_hmac_supported(self, algorithm: hashes.HashAlgorithm) -> bool:
160
+ return self.hmac_supported(algorithm)
161
+
162
+ def _consume_errors(self) -> list[rust_openssl.OpenSSLError]:
163
+ return rust_openssl.capture_error_stack()
164
+
165
+ def _oaep_hash_supported(self, algorithm: hashes.HashAlgorithm) -> bool:
166
+ if self._fips_enabled and isinstance(algorithm, hashes.SHA1):
167
+ return False
168
+
169
+ return isinstance(
170
+ algorithm,
171
+ (
172
+ hashes.SHA1,
173
+ hashes.SHA224,
174
+ hashes.SHA256,
175
+ hashes.SHA384,
176
+ hashes.SHA512,
177
+ ),
178
+ )
179
+
180
+ def rsa_padding_supported(self, padding: AsymmetricPadding) -> bool:
181
+ if isinstance(padding, PKCS1v15):
182
+ return True
183
+ elif isinstance(padding, PSS) and isinstance(padding._mgf, MGF1):
184
+ # FIPS 186-4 only allows salt length == digest length for PSS
185
+ # It is technically acceptable to set an explicit salt length
186
+ # equal to the digest length and this will incorrectly fail, but
187
+ # since we don't do that in the tests and this method is
188
+ # private, we'll ignore that until we need to do otherwise.
189
+ if (
190
+ self._fips_enabled
191
+ and padding._salt_length != PSS.DIGEST_LENGTH
192
+ ):
193
+ return False
194
+ return self.hash_supported(padding._mgf._algorithm)
195
+ elif isinstance(padding, OAEP) and isinstance(padding._mgf, MGF1):
196
+ return self._oaep_hash_supported(
197
+ padding._mgf._algorithm
198
+ ) and self._oaep_hash_supported(padding._algorithm)
199
+ else:
200
+ return False
201
+
202
+ def rsa_encryption_supported(self, padding: AsymmetricPadding) -> bool:
203
+ if self._fips_enabled and isinstance(padding, PKCS1v15):
204
+ return False
205
+ else:
206
+ return self.rsa_padding_supported(padding)
207
+
208
+ def dsa_supported(self) -> bool:
209
+ return (
210
+ not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
211
+ and not self._fips_enabled
212
+ )
213
+
214
+ def dsa_hash_supported(self, algorithm: hashes.HashAlgorithm) -> bool:
215
+ if not self.dsa_supported():
216
+ return False
217
+ return self.signature_hash_supported(algorithm)
218
+
219
+ def cmac_algorithm_supported(self, algorithm) -> bool:
220
+ return self.cipher_supported(
221
+ algorithm, CBC(b"\x00" * algorithm.block_size)
222
+ )
223
+
224
+ def elliptic_curve_supported(self, curve: ec.EllipticCurve) -> bool:
225
+ if self._fips_enabled and not isinstance(
226
+ curve, self._fips_ecdh_curves
227
+ ):
228
+ return False
229
+
230
+ return rust_openssl.ec.curve_supported(curve)
231
+
232
+ def elliptic_curve_signature_algorithm_supported(
233
+ self,
234
+ signature_algorithm: ec.EllipticCurveSignatureAlgorithm,
235
+ curve: ec.EllipticCurve,
236
+ ) -> bool:
237
+ # We only support ECDSA right now.
238
+ if not isinstance(signature_algorithm, ec.ECDSA):
239
+ return False
240
+
241
+ return self.elliptic_curve_supported(curve) and (
242
+ isinstance(signature_algorithm.algorithm, asym_utils.Prehashed)
243
+ or self.hash_supported(signature_algorithm.algorithm)
244
+ )
245
+
246
+ def elliptic_curve_exchange_algorithm_supported(
247
+ self, algorithm: ec.ECDH, curve: ec.EllipticCurve
248
+ ) -> bool:
249
+ return self.elliptic_curve_supported(curve) and isinstance(
250
+ algorithm, ec.ECDH
251
+ )
252
+
253
+ def dh_supported(self) -> bool:
254
+ return (
255
+ not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
256
+ and not rust_openssl.CRYPTOGRAPHY_IS_AWSLC
257
+ )
258
+
259
+ def dh_x942_serialization_supported(self) -> bool:
260
+ return self._lib.Cryptography_HAS_EVP_PKEY_DHX == 1
261
+
262
+ def x25519_supported(self) -> bool:
263
+ if self._fips_enabled:
264
+ return False
265
+ return True
266
+
267
+ def x448_supported(self) -> bool:
268
+ if self._fips_enabled:
269
+ return False
270
+ return (
271
+ not rust_openssl.CRYPTOGRAPHY_IS_LIBRESSL
272
+ and not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
273
+ and not rust_openssl.CRYPTOGRAPHY_IS_AWSLC
274
+ )
275
+
276
+ def ed25519_supported(self) -> bool:
277
+ if self._fips_enabled:
278
+ return False
279
+ return True
280
+
281
+ def ed448_supported(self) -> bool:
282
+ if self._fips_enabled:
283
+ return False
284
+ return (
285
+ not rust_openssl.CRYPTOGRAPHY_IS_LIBRESSL
286
+ and not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
287
+ and not rust_openssl.CRYPTOGRAPHY_IS_AWSLC
288
+ )
289
+
290
+ def ecdsa_deterministic_supported(self) -> bool:
291
+ return (
292
+ rust_openssl.CRYPTOGRAPHY_OPENSSL_320_OR_GREATER
293
+ and not self._fips_enabled
294
+ )
295
+
296
+ def poly1305_supported(self) -> bool:
297
+ if self._fips_enabled:
298
+ return False
299
+ return True
300
+
301
+ def pkcs7_supported(self) -> bool:
302
+ return (
303
+ not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
304
+ and not rust_openssl.CRYPTOGRAPHY_IS_AWSLC
305
+ )
306
+
307
+
308
+ backend = Backend()
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (186 Bytes). View file
 
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06db1cc8b574875fd6cbcccf4bd8343801b828e26c9ea2d51b5c3866a667af9b
3
+ size 12446840
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ import typing
6
+
7
+ from cryptography.hazmat.primitives import padding
8
+ from cryptography.utils import Buffer
9
+
10
+ class PKCS7PaddingContext(padding.PaddingContext):
11
+ def __init__(self, block_size: int) -> None: ...
12
+ def update(self, data: Buffer) -> bytes: ...
13
+ def finalize(self) -> bytes: ...
14
+
15
+ class ANSIX923PaddingContext(padding.PaddingContext):
16
+ def __init__(self, block_size: int) -> None: ...
17
+ def update(self, data: Buffer) -> bytes: ...
18
+ def finalize(self) -> bytes: ...
19
+
20
+ class PKCS7UnpaddingContext(padding.PaddingContext):
21
+ def __init__(self, block_size: int) -> None: ...
22
+ def update(self, data: Buffer) -> bytes: ...
23
+ def finalize(self) -> bytes: ...
24
+
25
+ class ANSIX923UnpaddingContext(padding.PaddingContext):
26
+ def __init__(self, block_size: int) -> None: ...
27
+ def update(self, data: Buffer) -> bytes: ...
28
+ def finalize(self) -> bytes: ...
29
+
30
+ class ObjectIdentifier:
31
+ def __init__(self, value: str) -> None: ...
32
+ @property
33
+ def dotted_string(self) -> str: ...
34
+ @property
35
+ def _name(self) -> str: ...
36
+
37
+ T = typing.TypeVar("T")
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ import typing
6
+
7
+ lib = typing.Any
8
+ ffi = typing.Any
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ def decode_dss_signature(signature: bytes) -> tuple[int, int]: ...
6
+ def encode_dss_signature(r: int, s: int) -> bytes: ...
7
+ def parse_spki_for_data(data: bytes) -> bytes: ...
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ class _Reasons:
6
+ BACKEND_MISSING_INTERFACE: _Reasons
7
+ UNSUPPORTED_HASH: _Reasons
8
+ UNSUPPORTED_CIPHER: _Reasons
9
+ UNSUPPORTED_PADDING: _Reasons
10
+ UNSUPPORTED_MGF: _Reasons
11
+ UNSUPPORTED_PUBLIC_KEY_ALGORITHM: _Reasons
12
+ UNSUPPORTED_ELLIPTIC_CURVE: _Reasons
13
+ UNSUPPORTED_SERIALIZATION: _Reasons
14
+ UNSUPPORTED_X509: _Reasons
15
+ UNSUPPORTED_EXCHANGE_ALGORITHM: _Reasons
16
+ UNSUPPORTED_DIFFIE_HELLMAN: _Reasons
17
+ UNSUPPORTED_MAC: _Reasons
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ import datetime
6
+ from collections.abc import Iterator
7
+
8
+ from cryptography import x509
9
+ from cryptography.hazmat.primitives import hashes, serialization
10
+ from cryptography.hazmat.primitives.asymmetric.types import PrivateKeyTypes
11
+ from cryptography.x509 import ocsp
12
+
13
+ class OCSPRequest:
14
+ @property
15
+ def issuer_key_hash(self) -> bytes: ...
16
+ @property
17
+ def issuer_name_hash(self) -> bytes: ...
18
+ @property
19
+ def hash_algorithm(self) -> hashes.HashAlgorithm: ...
20
+ @property
21
+ def serial_number(self) -> int: ...
22
+ def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
23
+ @property
24
+ def extensions(self) -> x509.Extensions: ...
25
+
26
+ class OCSPResponse:
27
+ @property
28
+ def responses(self) -> Iterator[OCSPSingleResponse]: ...
29
+ @property
30
+ def response_status(self) -> ocsp.OCSPResponseStatus: ...
31
+ @property
32
+ def signature_algorithm_oid(self) -> x509.ObjectIdentifier: ...
33
+ @property
34
+ def signature_hash_algorithm(
35
+ self,
36
+ ) -> hashes.HashAlgorithm | None: ...
37
+ @property
38
+ def signature(self) -> bytes: ...
39
+ @property
40
+ def tbs_response_bytes(self) -> bytes: ...
41
+ @property
42
+ def certificates(self) -> list[x509.Certificate]: ...
43
+ @property
44
+ def responder_key_hash(self) -> bytes | None: ...
45
+ @property
46
+ def responder_name(self) -> x509.Name | None: ...
47
+ @property
48
+ def produced_at(self) -> datetime.datetime: ...
49
+ @property
50
+ def produced_at_utc(self) -> datetime.datetime: ...
51
+ @property
52
+ def certificate_status(self) -> ocsp.OCSPCertStatus: ...
53
+ @property
54
+ def revocation_time(self) -> datetime.datetime | None: ...
55
+ @property
56
+ def revocation_time_utc(self) -> datetime.datetime | None: ...
57
+ @property
58
+ def revocation_reason(self) -> x509.ReasonFlags | None: ...
59
+ @property
60
+ def this_update(self) -> datetime.datetime: ...
61
+ @property
62
+ def this_update_utc(self) -> datetime.datetime: ...
63
+ @property
64
+ def next_update(self) -> datetime.datetime | None: ...
65
+ @property
66
+ def next_update_utc(self) -> datetime.datetime | None: ...
67
+ @property
68
+ def issuer_key_hash(self) -> bytes: ...
69
+ @property
70
+ def issuer_name_hash(self) -> bytes: ...
71
+ @property
72
+ def hash_algorithm(self) -> hashes.HashAlgorithm: ...
73
+ @property
74
+ def serial_number(self) -> int: ...
75
+ @property
76
+ def extensions(self) -> x509.Extensions: ...
77
+ @property
78
+ def single_extensions(self) -> x509.Extensions: ...
79
+ def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
80
+
81
+ class OCSPSingleResponse:
82
+ @property
83
+ def certificate_status(self) -> ocsp.OCSPCertStatus: ...
84
+ @property
85
+ def revocation_time(self) -> datetime.datetime | None: ...
86
+ @property
87
+ def revocation_time_utc(self) -> datetime.datetime | None: ...
88
+ @property
89
+ def revocation_reason(self) -> x509.ReasonFlags | None: ...
90
+ @property
91
+ def this_update(self) -> datetime.datetime: ...
92
+ @property
93
+ def this_update_utc(self) -> datetime.datetime: ...
94
+ @property
95
+ def next_update(self) -> datetime.datetime | None: ...
96
+ @property
97
+ def next_update_utc(self) -> datetime.datetime | None: ...
98
+ @property
99
+ def issuer_key_hash(self) -> bytes: ...
100
+ @property
101
+ def issuer_name_hash(self) -> bytes: ...
102
+ @property
103
+ def hash_algorithm(self) -> hashes.HashAlgorithm: ...
104
+ @property
105
+ def serial_number(self) -> int: ...
106
+
107
+ def load_der_ocsp_request(data: bytes) -> ocsp.OCSPRequest: ...
108
+ def load_der_ocsp_response(data: bytes) -> ocsp.OCSPResponse: ...
109
+ def create_ocsp_request(
110
+ builder: ocsp.OCSPRequestBuilder,
111
+ ) -> ocsp.OCSPRequest: ...
112
+ def create_ocsp_response(
113
+ status: ocsp.OCSPResponseStatus,
114
+ builder: ocsp.OCSPResponseBuilder | None,
115
+ private_key: PrivateKeyTypes | None,
116
+ hash_algorithm: hashes.HashAlgorithm | None,
117
+ ) -> ocsp.OCSPResponse: ...
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ import typing
6
+
7
+ from cryptography.hazmat.bindings._rust.openssl import (
8
+ aead,
9
+ ciphers,
10
+ cmac,
11
+ dh,
12
+ dsa,
13
+ ec,
14
+ ed448,
15
+ ed25519,
16
+ hashes,
17
+ hmac,
18
+ kdf,
19
+ keys,
20
+ poly1305,
21
+ rsa,
22
+ x448,
23
+ x25519,
24
+ )
25
+
26
+ __all__ = [
27
+ "aead",
28
+ "ciphers",
29
+ "cmac",
30
+ "dh",
31
+ "dsa",
32
+ "ec",
33
+ "ed448",
34
+ "ed25519",
35
+ "hashes",
36
+ "hmac",
37
+ "kdf",
38
+ "keys",
39
+ "openssl_version",
40
+ "openssl_version_text",
41
+ "poly1305",
42
+ "raise_openssl_error",
43
+ "rsa",
44
+ "x448",
45
+ "x25519",
46
+ ]
47
+
48
+ CRYPTOGRAPHY_IS_LIBRESSL: bool
49
+ CRYPTOGRAPHY_IS_BORINGSSL: bool
50
+ CRYPTOGRAPHY_IS_AWSLC: bool
51
+ CRYPTOGRAPHY_OPENSSL_300_OR_GREATER: bool
52
+ CRYPTOGRAPHY_OPENSSL_309_OR_GREATER: bool
53
+ CRYPTOGRAPHY_OPENSSL_320_OR_GREATER: bool
54
+ CRYPTOGRAPHY_OPENSSL_330_OR_GREATER: bool
55
+ CRYPTOGRAPHY_OPENSSL_350_OR_GREATER: bool
56
+
57
+ class Providers: ...
58
+
59
+ _legacy_provider_loaded: bool
60
+ _providers: Providers
61
+
62
+ def openssl_version() -> int: ...
63
+ def openssl_version_text() -> str: ...
64
+ def raise_openssl_error() -> typing.NoReturn: ...
65
+ def capture_error_stack() -> list[OpenSSLError]: ...
66
+ def is_fips_enabled() -> bool: ...
67
+ def enable_fips(providers: Providers) -> None: ...
68
+
69
+ class OpenSSLError:
70
+ @property
71
+ def lib(self) -> int: ...
72
+ @property
73
+ def reason(self) -> int: ...
74
+ @property
75
+ def reason_text(self) -> bytes: ...
venv/lib/python3.10/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from collections.abc import Sequence
6
+
7
+ from cryptography.utils import Buffer
8
+
9
+ class AESGCM:
10
+ def __init__(self, key: Buffer) -> None: ...
11
+ @staticmethod
12
+ def generate_key(bit_length: int) -> bytes: ...
13
+ def encrypt(
14
+ self,
15
+ nonce: Buffer,
16
+ data: Buffer,
17
+ associated_data: Buffer | None,
18
+ ) -> bytes: ...
19
+ def decrypt(
20
+ self,
21
+ nonce: Buffer,
22
+ data: Buffer,
23
+ associated_data: Buffer | None,
24
+ ) -> bytes: ...
25
+
26
+ class ChaCha20Poly1305:
27
+ def __init__(self, key: Buffer) -> None: ...
28
+ @staticmethod
29
+ def generate_key() -> bytes: ...
30
+ def encrypt(
31
+ self,
32
+ nonce: Buffer,
33
+ data: Buffer,
34
+ associated_data: Buffer | None,
35
+ ) -> bytes: ...
36
+ def decrypt(
37
+ self,
38
+ nonce: Buffer,
39
+ data: Buffer,
40
+ associated_data: Buffer | None,
41
+ ) -> bytes: ...
42
+
43
+ class AESCCM:
44
+ def __init__(self, key: Buffer, tag_length: int = 16) -> None: ...
45
+ @staticmethod
46
+ def generate_key(bit_length: int) -> bytes: ...
47
+ def encrypt(
48
+ self,
49
+ nonce: Buffer,
50
+ data: Buffer,
51
+ associated_data: Buffer | None,
52
+ ) -> bytes: ...
53
+ def decrypt(
54
+ self,
55
+ nonce: Buffer,
56
+ data: Buffer,
57
+ associated_data: Buffer | None,
58
+ ) -> bytes: ...
59
+
60
+ class AESSIV:
61
+ def __init__(self, key: Buffer) -> None: ...
62
+ @staticmethod
63
+ def generate_key(bit_length: int) -> bytes: ...
64
+ def encrypt(
65
+ self,
66
+ data: Buffer,
67
+ associated_data: Sequence[Buffer] | None,
68
+ ) -> bytes: ...
69
+ def decrypt(
70
+ self,
71
+ data: Buffer,
72
+ associated_data: Sequence[Buffer] | None,
73
+ ) -> bytes: ...
74
+
75
+ class AESOCB3:
76
+ def __init__(self, key: Buffer) -> None: ...
77
+ @staticmethod
78
+ def generate_key(bit_length: int) -> bytes: ...
79
+ def encrypt(
80
+ self,
81
+ nonce: Buffer,
82
+ data: Buffer,
83
+ associated_data: Buffer | None,
84
+ ) -> bytes: ...
85
+ def decrypt(
86
+ self,
87
+ nonce: Buffer,
88
+ data: Buffer,
89
+ associated_data: Buffer | None,
90
+ ) -> bytes: ...
91
+
92
+ class AESGCMSIV:
93
+ def __init__(self, key: Buffer) -> None: ...
94
+ @staticmethod
95
+ def generate_key(bit_length: int) -> bytes: ...
96
+ def encrypt(
97
+ self,
98
+ nonce: Buffer,
99
+ data: Buffer,
100
+ associated_data: Buffer | None,
101
+ ) -> bytes: ...
102
+ def decrypt(
103
+ self,
104
+ nonce: Buffer,
105
+ data: Buffer,
106
+ associated_data: Buffer | None,
107
+ ) -> bytes: ...