Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/INSTALLER +1 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/METADATA +125 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/RECORD +25 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/REQUESTED +0 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/WHEEL +4 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/direct_url.json +1 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/licenses/LICENSE +53 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/__init__.py +1 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/create.py +191 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/exceptions.py +19 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/extract.py +93 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/lazy_wheel.py +331 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/package_streaming.py +154 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/s3.py +83 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/transmute.py +162 -0
- miniconda3/lib/python3.13/site-packages/conda_package_streaming/url.py +100 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/INSTALLER +1 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/METADATA +139 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/RECORD +182 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/REQUESTED +0 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/WHEEL +4 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/direct_url.json +1 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/licenses/LICENSE +3 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/licenses/LICENSE.APACHE +202 -0
- miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/licenses/LICENSE.BSD +27 -0
- miniconda3/lib/python3.13/site-packages/cryptography/__about__.py +17 -0
- miniconda3/lib/python3.13/site-packages/cryptography/__init__.py +13 -0
- miniconda3/lib/python3.13/site-packages/cryptography/exceptions.py +52 -0
- miniconda3/lib/python3.13/site-packages/cryptography/fernet.py +224 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/__init__.py +13 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/_oid.py +356 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/asn1/__init__.py +10 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/asn1/asn1.py +116 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/backends/openssl/backend.py +302 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/declarative_asn1.pyi +32 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
- miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: conda_package_streaming
|
| 3 |
+
Version: 0.12.0
|
| 4 |
+
Summary: An efficient library to read from new and old format .conda and .tar.bz2 conda packages.
|
| 5 |
+
Author-email: "Anaconda, Inc. & Contributors" <conda@continuum.io>
|
| 6 |
+
Requires-Python: >=3.9
|
| 7 |
+
Description-Content-Type: text/markdown
|
| 8 |
+
Classifier: License :: OSI Approved :: BSD License
|
| 9 |
+
Classifier: Programming Language :: Python :: 3
|
| 10 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 11 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 12 |
+
License-File: LICENSE
|
| 13 |
+
Requires-Dist: requests
|
| 14 |
+
Requires-Dist: zstandard >=0.15
|
| 15 |
+
Requires-Dist: furo ; extra == "docs"
|
| 16 |
+
Requires-Dist: sphinx ; extra == "docs"
|
| 17 |
+
Requires-Dist: myst-parser ; extra == "docs"
|
| 18 |
+
Requires-Dist: mdit-py-plugins>=0.3.0 ; extra == "docs"
|
| 19 |
+
Requires-Dist: pytest >=7 ; extra == "test"
|
| 20 |
+
Requires-Dist: pytest-cov ; extra == "test"
|
| 21 |
+
Requires-Dist: pytest-mock ; extra == "test"
|
| 22 |
+
Requires-Dist: boto3 ; extra == "test"
|
| 23 |
+
Requires-Dist: boto3-stubs[essential] ; extra == "test"
|
| 24 |
+
Requires-Dist: bottle ; extra == "test"
|
| 25 |
+
Requires-Dist: conda ; extra == "test"
|
| 26 |
+
Requires-Dist: conda-package-handling >=2 ; extra == "test"
|
| 27 |
+
Requires-Dist: responses ; extra == "test"
|
| 28 |
+
Project-URL: Documentation, https://conda.github.io/conda-package-streaming/
|
| 29 |
+
Project-URL: Home, https://github.com/conda/conda-package-streaming
|
| 30 |
+
Provides-Extra: docs
|
| 31 |
+
Provides-Extra: test
|
| 32 |
+
|
| 33 |
+
# conda-package-streaming
|
| 34 |
+
|
| 35 |
+
[](https://results.pre-commit.ci/latest/github/conda/conda-package-streaming/main)
|
| 36 |
+
|
| 37 |
+
An efficient library to read from new and old format .conda and .tar.bz2 conda
|
| 38 |
+
packages.
|
| 39 |
+
|
| 40 |
+
Download conda metadata from packages without transferring entire file. Get
|
| 41 |
+
metadata from local `.tar.bz2` packages without reading entire files.
|
| 42 |
+
|
| 43 |
+
Uses enhanced pip `lazy_wheel` to fetch a file out of `.conda` with no more than
|
| 44 |
+
3 range requests, but usually 2.
|
| 45 |
+
|
| 46 |
+
Uses `tar = tarfile.open(fileobj=...)` to stream remote `.tar.bz2`. Closes the
|
| 47 |
+
HTTP request once desired files have been seen.
|
| 48 |
+
|
| 49 |
+
# Quickstart
|
| 50 |
+
|
| 51 |
+
The basic API yields (tarfile, member) tuples from conda files as tarfile is
|
| 52 |
+
needed to extract member. Note the `.tar.bz2` format yields all members, not
|
| 53 |
+
just `info/`, from `stream_conda_info` / `stream_conda_component`, while the
|
| 54 |
+
`.conda` format yields members from the requested inner archive — allowing the
|
| 55 |
+
caller to decide when to stop reading.
|
| 56 |
+
|
| 57 |
+
From a url,
|
| 58 |
+
```python
|
| 59 |
+
from conda_package_streaming.url import stream_conda_info
|
| 60 |
+
# url = (ends with .conda or .tar.bz2)
|
| 61 |
+
for tar, member in stream_conda_info(url):
|
| 62 |
+
if member.name == "info/index.json":
|
| 63 |
+
index_json = json.load(tar.extractfile(member))
|
| 64 |
+
break
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
From s3,
|
| 68 |
+
```python
|
| 69 |
+
client = boto3.client("s3")
|
| 70 |
+
from conda_package_streaming.s3 import stream_conda_info
|
| 71 |
+
# key = (ends with .conda or .tar.bz2)
|
| 72 |
+
for tar, member in stream_conda_info(client, bucket, key):
|
| 73 |
+
if member.name == "info/index.json":
|
| 74 |
+
index_json = json.load(tar.extractfile(member))
|
| 75 |
+
break
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
From a filename,
|
| 79 |
+
```python
|
| 80 |
+
from conda_package_streaming import package_streaming
|
| 81 |
+
# filename = (ends with .conda or .tar.bz2)
|
| 82 |
+
for tar, member in package_streaming.stream_conda_info(filename):
|
| 83 |
+
if member.name == "info/index.json":
|
| 84 |
+
index_json = json.load(tar.extractfile(member))
|
| 85 |
+
break
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
From a file-like object,
|
| 89 |
+
```python
|
| 90 |
+
from contextlib import closing
|
| 91 |
+
|
| 92 |
+
from conda_package_streaming.url import conda_reader_for_url
|
| 93 |
+
from conda_package_streaming.package_streaming import stream_conda_component
|
| 94 |
+
filename, conda = conda_reader_for_url(url)
|
| 95 |
+
|
| 96 |
+
# file object must be seekable for `.conda` format, but merely readable for `.tar.bz2`
|
| 97 |
+
with closing(conda):
|
| 98 |
+
for tar, member in stream_conda_component(filename, conda, component="info"):
|
| 99 |
+
if member.name == "info/index.json":
|
| 100 |
+
index_json = json.load(tar.extractfile(member))
|
| 101 |
+
break
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
If you need the entire package, download it first and use the file-based APIs.
|
| 105 |
+
The URL-based APIs are more efficient if you only need to access package
|
| 106 |
+
metadata.
|
| 107 |
+
|
| 108 |
+
# Package goals
|
| 109 |
+
|
| 110 |
+
* Extract conda packages (both formats)
|
| 111 |
+
* Easy to install from pypi or conda
|
| 112 |
+
* Do the least amount of I/O possible (no temporary files, transfer partial packages)
|
| 113 |
+
* Open files from the network / standard HTTP / s3
|
| 114 |
+
|
| 115 |
+
* Continue using conda-package-handling to create .conda packages
|
| 116 |
+
|
| 117 |
+
# Generating documentation
|
| 118 |
+
|
| 119 |
+
Uses markdown, furo theme. Requires newer mdit-py-plugins.
|
| 120 |
+
|
| 121 |
+
`pip install conda-package-streaming[docs]`
|
| 122 |
+
|
| 123 |
+
One time:
|
| 124 |
+
`sphinx-apidoc -o docs .`
|
| 125 |
+
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
conda_package_streaming-0.12.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
conda_package_streaming-0.12.0.dist-info/METADATA,sha256=lCyDK_zdW7svxhrpb4hh3-Z0u5jWULDb3Iio88SWl-M,4557
|
| 3 |
+
conda_package_streaming-0.12.0.dist-info/RECORD,,
|
| 4 |
+
conda_package_streaming-0.12.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 5 |
+
conda_package_streaming-0.12.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
| 6 |
+
conda_package_streaming-0.12.0.dist-info/direct_url.json,sha256=YjtlnLGPvwoJwtWoAtXcSU6g8U6tbPaVLW9QX9be--U,113
|
| 7 |
+
conda_package_streaming-0.12.0.dist-info/licenses/LICENSE,sha256=WPOScO-I9aoJgXok_DebNZN-PZhtB13xi1WqU0iqrWY,2670
|
| 8 |
+
conda_package_streaming/__init__.py,sha256=eHjt9DPsMbptabS2yGx9Yhbyzq5hFSUHXb7zc8Q_8-o,23
|
| 9 |
+
conda_package_streaming/__pycache__/__init__.cpython-313.pyc,,
|
| 10 |
+
conda_package_streaming/__pycache__/create.cpython-313.pyc,,
|
| 11 |
+
conda_package_streaming/__pycache__/exceptions.cpython-313.pyc,,
|
| 12 |
+
conda_package_streaming/__pycache__/extract.cpython-313.pyc,,
|
| 13 |
+
conda_package_streaming/__pycache__/lazy_wheel.cpython-313.pyc,,
|
| 14 |
+
conda_package_streaming/__pycache__/package_streaming.cpython-313.pyc,,
|
| 15 |
+
conda_package_streaming/__pycache__/s3.cpython-313.pyc,,
|
| 16 |
+
conda_package_streaming/__pycache__/transmute.cpython-313.pyc,,
|
| 17 |
+
conda_package_streaming/__pycache__/url.cpython-313.pyc,,
|
| 18 |
+
conda_package_streaming/create.py,sha256=7TvCl0HvJBnH5bO0RmUKab4avAIYg-xEp3bb-j48_8A,6142
|
| 19 |
+
conda_package_streaming/exceptions.py,sha256=7fG4CNtukkSRWAGh9Zg2DCNkhw-wNo-Oi35c2jf0VsQ,677
|
| 20 |
+
conda_package_streaming/extract.py,sha256=GoCq9CWukzycCHggFyhT-QVeSw56Yg4KfDgIKtZ7A3g,2935
|
| 21 |
+
conda_package_streaming/lazy_wheel.py,sha256=dCz7-BpEVCyVfpsQNtcesRpz0d9dZsM1ABwxXGJ-ZHU,12172
|
| 22 |
+
conda_package_streaming/package_streaming.py,sha256=DD7Pvrv1aH95lmAMHacBfCgElefq4Ojt443nlpRzXMU,5107
|
| 23 |
+
conda_package_streaming/s3.py,sha256=ygm59wSPpixvwkO4QqSgvalNUjAk1FzEXW0JNj45cgI,2286
|
| 24 |
+
conda_package_streaming/transmute.py,sha256=YUrjsuJl0wNK_RlCG8a80WxzF65o9zPaVOXMJMLCg-M,5540
|
| 25 |
+
conda_package_streaming/url.py,sha256=bZ_fO_BLWbz--Sc1QjAY4gRxMtGc8BEGqc8yBGAWPnE,3219
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/REQUESTED
ADDED
|
File without changes
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: flit 3.12.0
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/direct_url.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"dir_info": {}, "url": "file:///home/task_176236152622180/conda-bld/conda-package-streaming_1762361633858/work"}
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
BSD 3-Clause License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2022, Anaconda, Inc.
|
| 4 |
+
All rights reserved.
|
| 5 |
+
|
| 6 |
+
Redistribution and use in source and binary forms, with or without
|
| 7 |
+
modification, are permitted provided that the following conditions are met:
|
| 8 |
+
|
| 9 |
+
1. Redistributions of source code must retain the above copyright notice, this
|
| 10 |
+
list of conditions and the following disclaimer.
|
| 11 |
+
|
| 12 |
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
| 13 |
+
this list of conditions and the following disclaimer in the documentation
|
| 14 |
+
and/or other materials provided with the distribution.
|
| 15 |
+
|
| 16 |
+
3. Neither the name of the copyright holder nor the names of its
|
| 17 |
+
contributors may be used to endorse or promote products derived from
|
| 18 |
+
this software without specific prior written permission.
|
| 19 |
+
|
| 20 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 21 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 22 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 23 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
| 24 |
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 25 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 26 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 27 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 28 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 29 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 30 |
+
|
| 31 |
+
lazy_wheel.py:
|
| 32 |
+
|
| 33 |
+
Copyright (c) 2008-present The pip developers (see
|
| 34 |
+
https://github.com/pypa/pip/blob/main/AUTHORS.txt file)
|
| 35 |
+
|
| 36 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 37 |
+
a copy of this software and associated documentation files (the
|
| 38 |
+
"Software"), to deal in the Software without restriction, including
|
| 39 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 40 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 41 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 42 |
+
the following conditions:
|
| 43 |
+
|
| 44 |
+
The above copyright notice and this permission notice shall be
|
| 45 |
+
included in all copies or substantial portions of the Software.
|
| 46 |
+
|
| 47 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 48 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 49 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 50 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 51 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 52 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 53 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__version__ = "0.12.0"
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/create.py
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Tools for creating ``.conda``-format archives.
|
| 3 |
+
|
| 4 |
+
Uses ``tempfile.SpooledTemporaryFile`` to buffer ``pkg-*.tar`` and
|
| 5 |
+
``info-*.tar``, then compress directly into an open `ZipFile` at the end.
|
| 6 |
+
`SpooledTemporaryFile` buffers the first 10MB of the package and its metadata in
|
| 7 |
+
memory, but writes out to disk for larger packages.
|
| 8 |
+
|
| 9 |
+
Uses more disk space than ``conda-package-handling`` (temporary uncompressed
|
| 10 |
+
tarballs of the package contents) but accepts streams instead of just
|
| 11 |
+
files-on-the-filesystem.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import json
|
| 17 |
+
import shutil
|
| 18 |
+
import tarfile
|
| 19 |
+
import tempfile
|
| 20 |
+
import zipfile
|
| 21 |
+
from collections.abc import Iterator
|
| 22 |
+
from contextlib import contextmanager
|
| 23 |
+
from pathlib import Path
|
| 24 |
+
from typing import Callable
|
| 25 |
+
|
| 26 |
+
import zstandard
|
| 27 |
+
|
| 28 |
+
# increase to reduce speed and increase compression (levels above 19 use much
|
| 29 |
+
# more memory)
|
| 30 |
+
ZSTD_COMPRESS_LEVEL = 19
|
| 31 |
+
# increase to reduce compression and increase speed
|
| 32 |
+
ZSTD_COMPRESS_THREADS = 1
|
| 33 |
+
|
| 34 |
+
CONDA_PACKAGE_FORMAT_VERSION = 2
|
| 35 |
+
|
| 36 |
+
# Account for growth from "2 GB of /dev/urandom" to not exceed ZIP64_LIMIT after
|
| 37 |
+
# compression
|
| 38 |
+
CONDA_ZIP64_LIMIT = zipfile.ZIP64_LIMIT - (1 << 18) - 1
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def anonymize(tarinfo: tarfile.TarInfo):
|
| 42 |
+
"""
|
| 43 |
+
Pass to ``tarfile.add(..., filter=anonymize)`` to anonymize uid/gid.
|
| 44 |
+
|
| 45 |
+
Does not anonymize mtime or any other field.
|
| 46 |
+
"""
|
| 47 |
+
tarinfo.uid = tarinfo.gid = 0
|
| 48 |
+
tarinfo.uname = tarinfo.gname = ""
|
| 49 |
+
return tarinfo
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
class CondaTarFile(tarfile.TarFile):
|
| 53 |
+
"""
|
| 54 |
+
Subclass of :external+python:py:class:`tarfile.TarFile` that adds members to
|
| 55 |
+
a second ``info`` tar if they match ``is_info(name)``.
|
| 56 |
+
|
| 57 |
+
Create this with ``conda_builder(...)`` which sets up the component
|
| 58 |
+
archives, then wraps them into a ``.conda`` on exit.
|
| 59 |
+
|
| 60 |
+
Only useful for creating, not extracting ``.conda``.
|
| 61 |
+
"""
|
| 62 |
+
|
| 63 |
+
info_tar: tarfile.TarFile
|
| 64 |
+
is_info: Callable
|
| 65 |
+
|
| 66 |
+
def __init__(
|
| 67 |
+
self,
|
| 68 |
+
*args,
|
| 69 |
+
info_tar: tarfile.TarFile,
|
| 70 |
+
is_info=lambda name: name.startswith("info/"),
|
| 71 |
+
**kwargs,
|
| 72 |
+
):
|
| 73 |
+
super().__init__(*args, **kwargs)
|
| 74 |
+
self.info_tar = info_tar
|
| 75 |
+
self.is_info = is_info
|
| 76 |
+
|
| 77 |
+
def addfile(self, tarinfo, fileobj=None):
|
| 78 |
+
"""
|
| 79 |
+
Add the TarInfo object ``tarinfo`` to the archive. If ``fileobj`` is
|
| 80 |
+
given, it should be a binary file, and tarinfo.size bytes are read from
|
| 81 |
+
it and added to the archive. You can create TarInfo objects directly, or
|
| 82 |
+
by using ``gettarinfo()``.
|
| 83 |
+
|
| 84 |
+
If ``self.is_info(tarinfo.name)`` returns ``True``, add ``tarinfo`` to
|
| 85 |
+
``self.info_tar`` instead.
|
| 86 |
+
"""
|
| 87 |
+
if self.is_info(tarinfo.name):
|
| 88 |
+
return self.info_tar.addfile(tarinfo, fileobj=fileobj)
|
| 89 |
+
else:
|
| 90 |
+
return super().addfile(tarinfo, fileobj)
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
@contextmanager
|
| 94 |
+
def conda_builder(
|
| 95 |
+
stem,
|
| 96 |
+
path,
|
| 97 |
+
*,
|
| 98 |
+
compressor: Callable[
|
| 99 |
+
[], zstandard.ZstdCompressor
|
| 100 |
+
] = lambda: zstandard.ZstdCompressor(
|
| 101 |
+
level=ZSTD_COMPRESS_LEVEL, threads=ZSTD_COMPRESS_THREADS
|
| 102 |
+
),
|
| 103 |
+
is_info: Callable[[str], bool] = lambda filename: filename.startswith("info/"),
|
| 104 |
+
encoding="utf-8",
|
| 105 |
+
) -> Iterator[CondaTarFile]:
|
| 106 |
+
"""
|
| 107 |
+
Produce a ``TarFile`` subclass used to build a ``.conda`` package. The
|
| 108 |
+
subclass delegates ``addfile()`` to the ``info-`` component when ``is_info``
|
| 109 |
+
returns True.
|
| 110 |
+
|
| 111 |
+
When the context manager exits, ``{path}/{stem}.conda`` is written with
|
| 112 |
+
the component tar archives.
|
| 113 |
+
|
| 114 |
+
Args:
|
| 115 |
+
stem: output filename without extension
|
| 116 |
+
|
| 117 |
+
path: destination path for transmuted .conda package compressor: A
|
| 118 |
+
function that creates instances of ``zstandard.ZstdCompressor()``.
|
| 119 |
+
|
| 120 |
+
encoding: passed to TarFile constructor. Keep default "utf-8" for valid
|
| 121 |
+
.conda.
|
| 122 |
+
|
| 123 |
+
Yields:
|
| 124 |
+
``CondaTarFile``
|
| 125 |
+
"""
|
| 126 |
+
output_path = Path(path, f"{stem}.conda")
|
| 127 |
+
with (
|
| 128 |
+
tempfile.SpooledTemporaryFile() as info_file,
|
| 129 |
+
tempfile.SpooledTemporaryFile() as pkg_file,
|
| 130 |
+
):
|
| 131 |
+
with (
|
| 132 |
+
tarfile.TarFile(fileobj=info_file, mode="w", encoding=encoding) as info_tar,
|
| 133 |
+
CondaTarFile(
|
| 134 |
+
fileobj=pkg_file,
|
| 135 |
+
mode="w",
|
| 136 |
+
info_tar=info_tar,
|
| 137 |
+
is_info=is_info,
|
| 138 |
+
encoding=encoding,
|
| 139 |
+
) as pkg_tar,
|
| 140 |
+
):
|
| 141 |
+
# If we wanted to compress these at a low setting to save temporary
|
| 142 |
+
# space, we could insert a file object that counts bytes written in
|
| 143 |
+
# front of a zstd (level between 1..3) compressor.
|
| 144 |
+
yield pkg_tar
|
| 145 |
+
|
| 146 |
+
info_tar.close()
|
| 147 |
+
pkg_tar.close()
|
| 148 |
+
|
| 149 |
+
info_size = info_file.tell()
|
| 150 |
+
pkg_size = pkg_file.tell()
|
| 151 |
+
|
| 152 |
+
info_file.seek(0)
|
| 153 |
+
pkg_file.seek(0)
|
| 154 |
+
|
| 155 |
+
with zipfile.ZipFile(
|
| 156 |
+
output_path,
|
| 157 |
+
"x", # x to not append to existing
|
| 158 |
+
compresslevel=zipfile.ZIP_STORED,
|
| 159 |
+
) as conda_file:
|
| 160 |
+
# Use a maximum of one Zstd compressor, stream_writer at a time to save
|
| 161 |
+
# # memory.
|
| 162 |
+
data_compress = compressor()
|
| 163 |
+
|
| 164 |
+
pkg_metadata = {"conda_pkg_format_version": CONDA_PACKAGE_FORMAT_VERSION}
|
| 165 |
+
conda_file.writestr("metadata.json", json.dumps(pkg_metadata))
|
| 166 |
+
|
| 167 |
+
with (
|
| 168 |
+
conda_file.open(
|
| 169 |
+
f"pkg-{stem}.tar.zst",
|
| 170 |
+
"w",
|
| 171 |
+
force_zip64=(pkg_size > CONDA_ZIP64_LIMIT),
|
| 172 |
+
) as pkg_file_zip,
|
| 173 |
+
data_compress.stream_writer(
|
| 174 |
+
pkg_file_zip, size=pkg_size, closefd=False
|
| 175 |
+
) as pkg_stream,
|
| 176 |
+
):
|
| 177 |
+
shutil.copyfileobj(pkg_file._file, pkg_stream)
|
| 178 |
+
|
| 179 |
+
with (
|
| 180 |
+
conda_file.open(
|
| 181 |
+
f"info-{stem}.tar.zst",
|
| 182 |
+
"w",
|
| 183 |
+
force_zip64=(info_size > CONDA_ZIP64_LIMIT),
|
| 184 |
+
) as info_file_zip,
|
| 185 |
+
data_compress.stream_writer(
|
| 186 |
+
info_file_zip,
|
| 187 |
+
size=info_size,
|
| 188 |
+
closefd=False,
|
| 189 |
+
) as info_stream,
|
| 190 |
+
):
|
| 191 |
+
shutil.copyfileobj(info_file._file, info_stream)
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/exceptions.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import tarfile
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class SafetyError(tarfile.TarError):
|
| 5 |
+
def __init__(self, msg, *args, **kw):
|
| 6 |
+
msg = f"Error with archive. {msg}"
|
| 7 |
+
super().__init__(msg)
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class CaseInsensitiveFileSystemError(OSError):
|
| 11 |
+
def __init__(self):
|
| 12 |
+
message = """\
|
| 13 |
+
Cannot extract package to a case-insensitive file system. Your install
|
| 14 |
+
destination does not differentiate between upper and lowercase characters, and
|
| 15 |
+
this breaks things. Try installing to a location that is case-sensitive. Windows
|
| 16 |
+
drives are usually the culprit here - can you install to a native Unix drive, or
|
| 17 |
+
turn on case sensitivity for this (Windows) location?
|
| 18 |
+
"""
|
| 19 |
+
super().__init__(message)
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/extract.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Extract package to directory, with checks against tar members extracting outside
|
| 3 |
+
the target directory.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
from __future__ import annotations
|
| 7 |
+
|
| 8 |
+
import os
|
| 9 |
+
import tarfile
|
| 10 |
+
from collections.abc import Generator
|
| 11 |
+
from errno import ELOOP
|
| 12 |
+
from pathlib import Path
|
| 13 |
+
|
| 14 |
+
from . import exceptions, package_streaming
|
| 15 |
+
|
| 16 |
+
__all__ = ["extract_stream", "extract"]
|
| 17 |
+
HAS_TAR_FILTER = hasattr(tarfile, "tar_filter")
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def extract_stream(
|
| 21 |
+
stream: Generator[tuple[tarfile.TarFile, tarfile.TarInfo]],
|
| 22 |
+
dest_dir: Path | str,
|
| 23 |
+
tar_filter: str | None = None,
|
| 24 |
+
):
|
| 25 |
+
"""
|
| 26 |
+
Pipe ``stream_conda_component`` output here to extract every member into
|
| 27 |
+
dest_dir.
|
| 28 |
+
|
| 29 |
+
For ``.conda`` will need to be called twice (for info and pkg components);
|
| 30 |
+
for ``.tar.bz2`` every member is extracted.
|
| 31 |
+
"""
|
| 32 |
+
dest_dir = os.path.realpath(dest_dir)
|
| 33 |
+
|
| 34 |
+
def is_within_dest_dir(name):
|
| 35 |
+
abs_target = os.path.realpath(os.path.join(dest_dir, name))
|
| 36 |
+
prefix = os.path.commonpath((dest_dir, abs_target))
|
| 37 |
+
return prefix == dest_dir
|
| 38 |
+
|
| 39 |
+
for tar_file, _ in stream:
|
| 40 |
+
# careful not to seek backwards
|
| 41 |
+
def checked_members():
|
| 42 |
+
# from conda_package_handling
|
| 43 |
+
for member in tar_file:
|
| 44 |
+
if not is_within_dest_dir(member.name):
|
| 45 |
+
raise exceptions.SafetyError(f"contains unsafe path: {member.name}")
|
| 46 |
+
yield member
|
| 47 |
+
|
| 48 |
+
try:
|
| 49 |
+
# Drop checked_members() when HAS_TAR_FILTER once we are 100%
|
| 50 |
+
# certain the stdlib filter maintains same permissions as
|
| 51 |
+
# checked_members().
|
| 52 |
+
tar_args = {"path": dest_dir, "members": checked_members()}
|
| 53 |
+
if HAS_TAR_FILTER:
|
| 54 |
+
tar_args["filter"] = tar_filter or "fully_trusted"
|
| 55 |
+
tar_file.extractall(**tar_args)
|
| 56 |
+
except OSError as e:
|
| 57 |
+
if e.errno == ELOOP:
|
| 58 |
+
raise exceptions.CaseInsensitiveFileSystemError() from e
|
| 59 |
+
raise
|
| 60 |
+
|
| 61 |
+
# next iteraton of for loop raises GeneratorExit in stream
|
| 62 |
+
stream.close()
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def extract(filename, dest_dir=None, fileobj=None):
|
| 66 |
+
"""
|
| 67 |
+
Extract all components of conda package to dest_dir.
|
| 68 |
+
|
| 69 |
+
fileobj: must be seekable if provided, if a ``.conda`` package.
|
| 70 |
+
"""
|
| 71 |
+
assert dest_dir, "dest_dir is required"
|
| 72 |
+
if str(filename).endswith(".conda"):
|
| 73 |
+
components = [
|
| 74 |
+
package_streaming.CondaComponent.pkg,
|
| 75 |
+
package_streaming.CondaComponent.info,
|
| 76 |
+
]
|
| 77 |
+
else: # .tar.bz2 doesn't filter by component
|
| 78 |
+
components = [package_streaming.CondaComponent.pkg]
|
| 79 |
+
|
| 80 |
+
closefd = False
|
| 81 |
+
if not fileobj:
|
| 82 |
+
fileobj = open(filename, "rb")
|
| 83 |
+
closefd = True
|
| 84 |
+
|
| 85 |
+
try:
|
| 86 |
+
for component in components:
|
| 87 |
+
stream = package_streaming.stream_conda_component(
|
| 88 |
+
filename, fileobj, component=component
|
| 89 |
+
)
|
| 90 |
+
extract_stream(stream, dest_dir)
|
| 91 |
+
finally:
|
| 92 |
+
if closefd:
|
| 93 |
+
fileobj.close()
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/lazy_wheel.py
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Lazy ZIP over HTTP"""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import logging
|
| 6 |
+
import zipfile
|
| 7 |
+
from bisect import bisect_left, bisect_right
|
| 8 |
+
from collections.abc import Iterator
|
| 9 |
+
from contextlib import contextmanager
|
| 10 |
+
from tempfile import NamedTemporaryFile
|
| 11 |
+
from typing import Any
|
| 12 |
+
from zipfile import BadZipfile, ZipFile
|
| 13 |
+
|
| 14 |
+
from requests import HTTPError, Session
|
| 15 |
+
from requests.models import CONTENT_CHUNK_SIZE, Response
|
| 16 |
+
|
| 17 |
+
# from pip 22.0.3 with fixes & remove imports from pip
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
log = logging.getLogger(__name__)
|
| 21 |
+
|
| 22 |
+
# If-Match (etag) to detect file changed during fetch would also be nice
|
| 23 |
+
HEADERS = {"Accept-Encoding": "identity"}
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
class HTTPRangeRequestUnsupported(Exception):
|
| 27 |
+
pass
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class LazyZipOverHTTP:
|
| 31 |
+
"""File-like object mapped to a ZIP file over HTTP.
|
| 32 |
+
|
| 33 |
+
This uses HTTP range requests to lazily fetch the file's content,
|
| 34 |
+
which is supposed to be fed to ZipFile. If such requests are not
|
| 35 |
+
supported by the server, raise HTTPRangeRequestUnsupported
|
| 36 |
+
during initialization.
|
| 37 |
+
"""
|
| 38 |
+
|
| 39 |
+
def __init__(
|
| 40 |
+
self,
|
| 41 |
+
url: str,
|
| 42 |
+
session: Session,
|
| 43 |
+
chunk_size: int = CONTENT_CHUNK_SIZE,
|
| 44 |
+
fall_back_to_full_download: bool = False,
|
| 45 |
+
) -> None:
|
| 46 |
+
"""
|
| 47 |
+
Initialize a LazyZipOverHTTP object.
|
| 48 |
+
|
| 49 |
+
:param session: The session to use for web requests.
|
| 50 |
+
:param chunk_size: The chunk size to use for downloading.
|
| 51 |
+
:param fall_back_to_full_download: If true, we fall back to downloading
|
| 52 |
+
the whole file if the server incorrectly responds with 416
|
| 53 |
+
(Range Not Satisfiable) to an HTTP range request.
|
| 54 |
+
"""
|
| 55 |
+
# if CONTENT_CHUNK_SIZE is bigger than the file:
|
| 56 |
+
# In [8]: response.headers["Content-Range"]
|
| 57 |
+
# Out[8]: 'bytes 0-3133374/3133375'
|
| 58 |
+
|
| 59 |
+
self._request_count = 0
|
| 60 |
+
|
| 61 |
+
self._session, self._url, self._chunk_size = session, url, chunk_size
|
| 62 |
+
|
| 63 |
+
self._fall_back_to_full_download: bool = fall_back_to_full_download
|
| 64 |
+
self._has_streaming_support: bool = True
|
| 65 |
+
|
| 66 |
+
# If the server returns 416 (Range Not Satisfiable) and the fallback is
|
| 67 |
+
# enabled, we request the whole file and set this to False. Some package
|
| 68 |
+
# servers incorrectly respond with 416 (Range Not Satisfiable) if the
|
| 69 |
+
# file is smaller than the range requested.
|
| 70 |
+
|
| 71 |
+
# initial range request for the end of the file
|
| 72 |
+
# if the server does not support range requests, this sets
|
| 73 |
+
# _has_streaming_support to False
|
| 74 |
+
tail = self._stream_response(start="", end=CONTENT_CHUNK_SIZE)
|
| 75 |
+
# e.g. {'accept-ranges': 'bytes', 'content-length': '10240',
|
| 76 |
+
# 'content-range': 'bytes 12824-23063/23064', 'last-modified': 'Sat, 16
|
| 77 |
+
# Apr 2022 13:03:02 GMT', 'date': 'Thu, 21 Apr 2022 11:34:04 GMT'}
|
| 78 |
+
|
| 79 |
+
if self._has_streaming_support and tail.status_code != 206:
|
| 80 |
+
raise HTTPRangeRequestUnsupported("range request is not supported")
|
| 81 |
+
|
| 82 |
+
if self._has_streaming_support:
|
| 83 |
+
# lowercase content-range to support s3
|
| 84 |
+
self._length = int(tail.headers["content-range"].partition("/")[-1])
|
| 85 |
+
else:
|
| 86 |
+
# the file is already downloaded
|
| 87 |
+
self._length = len(tail.content)
|
| 88 |
+
|
| 89 |
+
self._file = NamedTemporaryFile()
|
| 90 |
+
self.truncate(self._length)
|
| 91 |
+
|
| 92 |
+
# length is also in Content-Length and Content-Range header
|
| 93 |
+
with self._stay():
|
| 94 |
+
if self._has_streaming_support:
|
| 95 |
+
content_length = int(tail.headers["content-length"])
|
| 96 |
+
if hasattr(tail, "content"):
|
| 97 |
+
assert content_length == len(tail.content)
|
| 98 |
+
else:
|
| 99 |
+
content_length = len(tail.content)
|
| 100 |
+
self.seek(self._length - content_length)
|
| 101 |
+
for chunk in tail.iter_content(self._chunk_size):
|
| 102 |
+
self._file.write(chunk)
|
| 103 |
+
self._left: list[int] = [self._length - content_length]
|
| 104 |
+
self._right: list[int] = [self._length - 1]
|
| 105 |
+
|
| 106 |
+
@property
|
| 107 |
+
def mode(self) -> str:
|
| 108 |
+
"""Opening mode, which is always rb."""
|
| 109 |
+
return "rb"
|
| 110 |
+
|
| 111 |
+
@property
|
| 112 |
+
def name(self) -> str:
|
| 113 |
+
"""Path to the underlying file."""
|
| 114 |
+
return self._file.name
|
| 115 |
+
|
| 116 |
+
def seekable(self) -> bool:
|
| 117 |
+
"""Return whether random access is supported, which is True."""
|
| 118 |
+
return True
|
| 119 |
+
|
| 120 |
+
def close(self) -> None:
|
| 121 |
+
"""Close the file."""
|
| 122 |
+
self._file.close()
|
| 123 |
+
|
| 124 |
+
@property
|
| 125 |
+
def closed(self) -> bool:
|
| 126 |
+
"""Whether the file is closed."""
|
| 127 |
+
return self._file.closed
|
| 128 |
+
|
| 129 |
+
def read(self, size: int = -1) -> bytes:
|
| 130 |
+
"""Read up to size bytes from the object and return them.
|
| 131 |
+
|
| 132 |
+
As a convenience, if size is unspecified or -1,
|
| 133 |
+
all bytes until EOF are returned. Fewer than
|
| 134 |
+
size bytes may be returned if EOF is reached.
|
| 135 |
+
"""
|
| 136 |
+
# BUG does not download correctly if size is unspecified
|
| 137 |
+
download_size = size
|
| 138 |
+
start, length = self.tell(), self._length
|
| 139 |
+
stop = length if size < 0 else min(start + download_size, length)
|
| 140 |
+
start = max(0, stop - download_size)
|
| 141 |
+
self._download(start, stop - 1)
|
| 142 |
+
return self._file.read(size)
|
| 143 |
+
|
| 144 |
+
def readable(self) -> bool:
|
| 145 |
+
"""Return whether the file is readable, which is True."""
|
| 146 |
+
return True
|
| 147 |
+
|
| 148 |
+
def seek(self, offset: int, whence: int = 0) -> int:
|
| 149 |
+
"""Change stream position and return the new absolute position.
|
| 150 |
+
|
| 151 |
+
Seek to offset relative position indicated by whence:
|
| 152 |
+
* 0: Start of stream (the default). pos should be >= 0;
|
| 153 |
+
* 1: Current position - pos may be negative;
|
| 154 |
+
* 2: End of stream - pos usually negative.
|
| 155 |
+
"""
|
| 156 |
+
return self._file.seek(offset, whence)
|
| 157 |
+
|
| 158 |
+
def tell(self) -> int:
|
| 159 |
+
"""Return the current position."""
|
| 160 |
+
return self._file.tell()
|
| 161 |
+
|
| 162 |
+
def truncate(self, size: int | None = None) -> int:
|
| 163 |
+
"""Resize the stream to the given size in bytes.
|
| 164 |
+
|
| 165 |
+
If size is unspecified resize to the current position.
|
| 166 |
+
The current stream position isn't changed.
|
| 167 |
+
|
| 168 |
+
Return the new file size.
|
| 169 |
+
"""
|
| 170 |
+
return self._file.truncate(size)
|
| 171 |
+
|
| 172 |
+
def writable(self) -> bool:
|
| 173 |
+
"""Return False."""
|
| 174 |
+
return False
|
| 175 |
+
|
| 176 |
+
def __enter__(self) -> LazyZipOverHTTP:
|
| 177 |
+
self._file.__enter__()
|
| 178 |
+
return self
|
| 179 |
+
|
| 180 |
+
def __exit__(self, *exc: Any) -> bool | None:
|
| 181 |
+
return self._file.__exit__(*exc)
|
| 182 |
+
|
| 183 |
+
@contextmanager
|
| 184 |
+
def _stay(self) -> Iterator[None]:
|
| 185 |
+
"""Return a context manager keeping the position.
|
| 186 |
+
|
| 187 |
+
At the end of the block, seek back to original position.
|
| 188 |
+
"""
|
| 189 |
+
pos = self.tell()
|
| 190 |
+
try:
|
| 191 |
+
yield
|
| 192 |
+
finally:
|
| 193 |
+
self.seek(pos)
|
| 194 |
+
|
| 195 |
+
def _check_zip(self) -> None:
|
| 196 |
+
"""Check and download until the file is a valid ZIP."""
|
| 197 |
+
end = self._length - 1
|
| 198 |
+
for start in reversed(range(0, end, self._chunk_size)):
|
| 199 |
+
self._download(start, end)
|
| 200 |
+
with self._stay():
|
| 201 |
+
try:
|
| 202 |
+
# For read-only ZIP files, ZipFile only needs
|
| 203 |
+
# methods read, seek, seekable and tell.
|
| 204 |
+
ZipFile(self) # type: ignore
|
| 205 |
+
except BadZipfile:
|
| 206 |
+
pass
|
| 207 |
+
else:
|
| 208 |
+
break
|
| 209 |
+
|
| 210 |
+
def _stream_response(
|
| 211 |
+
self, start: int | str, end: int, base_headers: dict[str, str] = HEADERS
|
| 212 |
+
) -> Response:
|
| 213 |
+
"""
|
| 214 |
+
Return HTTP response to a range request from start to end.
|
| 215 |
+
If the does not support range requests, the whole file is requested.
|
| 216 |
+
|
| 217 |
+
:param start: if "", request `end` bytes from end of file.
|
| 218 |
+
"""
|
| 219 |
+
headers = base_headers.copy()
|
| 220 |
+
headers["Range"] = f"bytes={start}-{end}"
|
| 221 |
+
log.debug("%s", headers["Range"])
|
| 222 |
+
# TODO: Get range requests to be correctly cached
|
| 223 |
+
headers["Cache-Control"] = "no-cache"
|
| 224 |
+
self._request_count += 1
|
| 225 |
+
|
| 226 |
+
if self._has_streaming_support:
|
| 227 |
+
response = self._session.get(self._url, headers=headers, stream=True)
|
| 228 |
+
|
| 229 |
+
if response.status_code == 416 and self._fall_back_to_full_download:
|
| 230 |
+
# Range Not Satisfiable -> enable fallback
|
| 231 |
+
self._has_streaming_support = False
|
| 232 |
+
elif response.status_code == 416:
|
| 233 |
+
# fallback disabled, print helpful error message
|
| 234 |
+
raise HTTPError(
|
| 235 |
+
"The server returned 416 (Range Not Satisfiable). "
|
| 236 |
+
"This can occur on a buggy server if the file is smaller "
|
| 237 |
+
"than the range requested. Set the fall_back_to_full_download flag "
|
| 238 |
+
"to work around this issue.",
|
| 239 |
+
response=response,
|
| 240 |
+
)
|
| 241 |
+
else:
|
| 242 |
+
response.raise_for_status()
|
| 243 |
+
return response
|
| 244 |
+
|
| 245 |
+
# no streaming support, try to get the whole file
|
| 246 |
+
del headers["Range"]
|
| 247 |
+
response = self._session.get(self._url, headers=headers, stream=True)
|
| 248 |
+
|
| 249 |
+
response.raise_for_status()
|
| 250 |
+
return response
|
| 251 |
+
|
| 252 |
+
def _merge(
|
| 253 |
+
self, start: int, end: int, left: int, right: int
|
| 254 |
+
) -> Iterator[tuple[int, int]]:
|
| 255 |
+
"""Return an iterator of intervals to be fetched.
|
| 256 |
+
|
| 257 |
+
Args:
|
| 258 |
+
start (int): Start of needed interval
|
| 259 |
+
end (int): End of needed interval
|
| 260 |
+
left (int): Index of first overlapping downloaded data
|
| 261 |
+
right (int): Index after last overlapping downloaded data
|
| 262 |
+
"""
|
| 263 |
+
lslice, rslice = self._left[left:right], self._right[left:right]
|
| 264 |
+
i = start = min([start] + lslice[:1])
|
| 265 |
+
end = max([end] + rslice[-1:])
|
| 266 |
+
for j, k in zip(lslice, rslice):
|
| 267 |
+
if j > i:
|
| 268 |
+
yield i, j - 1
|
| 269 |
+
i = k + 1
|
| 270 |
+
if i <= end:
|
| 271 |
+
yield i, end
|
| 272 |
+
self._left[left:right], self._right[left:right] = [start], [end]
|
| 273 |
+
|
| 274 |
+
def _download(self, start: int, end: int) -> None:
|
| 275 |
+
"""
|
| 276 |
+
Download bytes from start to end inclusively. If the server does not support
|
| 277 |
+
streaming for this file, this does nothing as the entire file is already
|
| 278 |
+
downloaded.
|
| 279 |
+
"""
|
| 280 |
+
# these assertions should hold, but read() violates them
|
| 281 |
+
# assert 0 <= start <= end
|
| 282 |
+
# assert end < self._length
|
| 283 |
+
|
| 284 |
+
with self._stay():
|
| 285 |
+
left = bisect_left(self._right, start)
|
| 286 |
+
right = bisect_right(self._left, end)
|
| 287 |
+
for start, end in self._merge(start, end, left, right):
|
| 288 |
+
response = self._stream_response(start, end)
|
| 289 |
+
self.seek(start)
|
| 290 |
+
for chunk in response.iter_content(self._chunk_size):
|
| 291 |
+
self._file.write(chunk)
|
| 292 |
+
|
| 293 |
+
|
| 294 |
+
class LazyConda(LazyZipOverHTTP):
|
| 295 |
+
def prefetch(self, conda_file_id):
|
| 296 |
+
"""
|
| 297 |
+
Conda fork specific. Prefetch the `.info` range from the remote archive.
|
| 298 |
+
Reduces number of Range requests to 2 or 3 (1 or 2 for the directory, 1
|
| 299 |
+
for the file).
|
| 300 |
+
|
| 301 |
+
conda_file_id: name of .conda without path or `.conda` extension
|
| 302 |
+
"""
|
| 303 |
+
target_file = f"info-{conda_file_id}.tar.zst"
|
| 304 |
+
with self._stay(): # not strictly necessary
|
| 305 |
+
# try to read entire conda info in one request
|
| 306 |
+
zf = zipfile.ZipFile(self)
|
| 307 |
+
infolist = zf.infolist()
|
| 308 |
+
for i, info in enumerate(infolist):
|
| 309 |
+
if info.filename == target_file:
|
| 310 |
+
# could be incorrect if zipfile was concatenated to another
|
| 311 |
+
# file (not likely for .conda)
|
| 312 |
+
start = info.header_offset
|
| 313 |
+
try:
|
| 314 |
+
end = infolist[i + 1].header_offset
|
| 315 |
+
# or info.header_offset
|
| 316 |
+
# + len(info.filename)
|
| 317 |
+
# + len(info.extra)
|
| 318 |
+
# + info.compress_size
|
| 319 |
+
# (unless Zip64)
|
| 320 |
+
except IndexError:
|
| 321 |
+
end = zf.start_dir
|
| 322 |
+
self.seek(start)
|
| 323 |
+
self.read(end - start)
|
| 324 |
+
log.debug(
|
| 325 |
+
"prefetch %s-%s",
|
| 326 |
+
info.header_offset,
|
| 327 |
+
end,
|
| 328 |
+
)
|
| 329 |
+
break
|
| 330 |
+
else:
|
| 331 |
+
log.debug("no zip prefetch")
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/package_streaming.py
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Unpack conda packages without using a temporary file.
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from __future__ import annotations
|
| 6 |
+
|
| 7 |
+
import bz2
|
| 8 |
+
import os
|
| 9 |
+
import os.path
|
| 10 |
+
import tarfile
|
| 11 |
+
import zipfile
|
| 12 |
+
from collections.abc import Generator
|
| 13 |
+
from enum import Enum
|
| 14 |
+
|
| 15 |
+
# acquire umask taking advantage of import system lock, instead of possibly in
|
| 16 |
+
# multiple threads at once.
|
| 17 |
+
UMASK = os.umask(0)
|
| 18 |
+
os.umask(UMASK)
|
| 19 |
+
|
| 20 |
+
try:
|
| 21 |
+
import zstandard
|
| 22 |
+
except ImportError:
|
| 23 |
+
import warnings
|
| 24 |
+
|
| 25 |
+
warnings.warn("zstandard could not be imported. Running without .conda support.")
|
| 26 |
+
|
| 27 |
+
zstandard = None
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class CondaComponent(Enum):
|
| 31 |
+
pkg = "pkg"
|
| 32 |
+
info = "info"
|
| 33 |
+
|
| 34 |
+
def __str__(self):
|
| 35 |
+
return self.value
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
class TarfileNoSameOwner(tarfile.TarFile):
|
| 39 |
+
def __init__(self, *args, umask: int | None = None, **kwargs):
|
| 40 |
+
"""Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
|
| 41 |
+
read from an existing archive, 'a' to append data to an existing
|
| 42 |
+
file or 'w' to create a new file overwriting an existing one. `mode'
|
| 43 |
+
defaults to 'r'.
|
| 44 |
+
If `fileobj' is given, it is used for reading or writing data. If it
|
| 45 |
+
can be determined, `mode' is overridden by `fileobj's mode.
|
| 46 |
+
`fileobj' is not closed, when TarFile is closed.
|
| 47 |
+
"""
|
| 48 |
+
super().__init__(*args, **kwargs)
|
| 49 |
+
self.umask = umask if umask is not None else UMASK
|
| 50 |
+
|
| 51 |
+
def chown(self, tarinfo, targetpath, numeric_owner):
|
| 52 |
+
"""
|
| 53 |
+
Override chown to be a no-op, since we don't want to preserve ownership
|
| 54 |
+
here. (tarfile.TarFile only lets us toggle all of (chown, chmod, mtime))
|
| 55 |
+
"""
|
| 56 |
+
return
|
| 57 |
+
|
| 58 |
+
def chmod(self, tarinfo, targetpath):
|
| 59 |
+
"""
|
| 60 |
+
Set file permissions of targetpath according to tarinfo, respecting
|
| 61 |
+
umask.
|
| 62 |
+
"""
|
| 63 |
+
if tarinfo.mode is None:
|
| 64 |
+
return
|
| 65 |
+
|
| 66 |
+
try:
|
| 67 |
+
os.chmod(targetpath, tarinfo.mode & (-1 & (~self.umask)))
|
| 68 |
+
except OSError as e:
|
| 69 |
+
raise tarfile.ExtractError("could not change mode") from e
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def tar_generator(
|
| 73 |
+
fileobj, tarfile_open=TarfileNoSameOwner.open, closefd=False, *, encoding="utf-8"
|
| 74 |
+
) -> Generator[tuple[tarfile.TarFile, tarfile.TarInfo]]:
|
| 75 |
+
"""
|
| 76 |
+
Yield (tar, member) from fileobj.
|
| 77 |
+
|
| 78 |
+
Args:
|
| 79 |
+
fileobj: file-like object
|
| 80 |
+
|
| 81 |
+
encoding: "utf-8" passed to TarFile.open(); can be changed for testing.
|
| 82 |
+
"""
|
| 83 |
+
# tarfile will not close fileobj because _extfileobj is True
|
| 84 |
+
# caller should take care to close files all the way back to the http request...
|
| 85 |
+
try:
|
| 86 |
+
with tarfile_open(fileobj=fileobj, mode="r|", encoding=encoding) as tar:
|
| 87 |
+
for member in tar:
|
| 88 |
+
yield tar, member
|
| 89 |
+
finally:
|
| 90 |
+
if closefd:
|
| 91 |
+
fileobj.close()
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def stream_conda_info(
|
| 95 |
+
filename, fileobj=None
|
| 96 |
+
) -> Generator[tuple[tarfile.TarFile, tarfile.TarInfo]]:
|
| 97 |
+
"""
|
| 98 |
+
Yield members from conda's embedded info/ tarball.
|
| 99 |
+
|
| 100 |
+
For .tar.bz2 packages, yield all members.
|
| 101 |
+
|
| 102 |
+
Yields (tar, member) tuples. You must only use the current member to
|
| 103 |
+
prevent tar seeks and scans.
|
| 104 |
+
|
| 105 |
+
To extract to disk, it's possible to call ``tar.extractall(path)`` on the
|
| 106 |
+
first result and then ignore the rest of this generator. ``extractall`` takes
|
| 107 |
+
care of some directory permissions/mtime issues, compared to ``extract`` or
|
| 108 |
+
writing out the file objects yourself.
|
| 109 |
+
"""
|
| 110 |
+
component = "info"
|
| 111 |
+
return stream_conda_component(filename, fileobj, component)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
def stream_conda_component(
|
| 115 |
+
filename,
|
| 116 |
+
fileobj=None,
|
| 117 |
+
component: CondaComponent | str = CondaComponent.pkg,
|
| 118 |
+
*,
|
| 119 |
+
encoding="utf-8",
|
| 120 |
+
) -> Generator[tuple[tarfile.TarFile, tarfile.TarInfo]]:
|
| 121 |
+
"""
|
| 122 |
+
Yield members from .conda's embedded {component}- tarball. "info" or "pkg".
|
| 123 |
+
|
| 124 |
+
For .tar.bz2 packages, yield all members.
|
| 125 |
+
|
| 126 |
+
Yields (tar, member) tuples. You must only use the current member to
|
| 127 |
+
prevent tar seeks and scans.
|
| 128 |
+
|
| 129 |
+
To extract to disk, it's possible to call ``tar.extractall(path)`` on the
|
| 130 |
+
first result and then ignore the rest of this generator. ``extractall`` takes
|
| 131 |
+
care of some directory permissions/mtime issues, compared to ``extract`` or
|
| 132 |
+
writing out the file objects yourself.
|
| 133 |
+
"""
|
| 134 |
+
if str(filename).endswith(".conda"):
|
| 135 |
+
if zstandard is None:
|
| 136 |
+
raise RuntimeError("Cannot unpack `.conda` without zstandard")
|
| 137 |
+
|
| 138 |
+
zf = zipfile.ZipFile(fileobj or filename)
|
| 139 |
+
stem, _, _ = os.path.basename(filename).rpartition(".")
|
| 140 |
+
component_name = f"{component}-{stem}"
|
| 141 |
+
component_filename = [
|
| 142 |
+
info for info in zf.infolist() if info.filename.startswith(component_name)
|
| 143 |
+
]
|
| 144 |
+
if not component_filename:
|
| 145 |
+
raise LookupError(f"didn't find {component_name} component in {filename}")
|
| 146 |
+
assert len(component_filename) == 1
|
| 147 |
+
reader = zstandard.ZstdDecompressor().stream_reader(
|
| 148 |
+
zf.open(component_filename[0])
|
| 149 |
+
)
|
| 150 |
+
elif str(filename).endswith(".tar.bz2"):
|
| 151 |
+
reader = bz2.open(fileobj or filename, mode="rb")
|
| 152 |
+
else:
|
| 153 |
+
raise ValueError("unsupported file extension")
|
| 154 |
+
return tar_generator(reader, closefd=fileobj is None, encoding=encoding)
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/s3.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Adapt s3 to package_streaming
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from __future__ import annotations
|
| 6 |
+
|
| 7 |
+
import typing
|
| 8 |
+
from contextlib import closing
|
| 9 |
+
from typing import Any
|
| 10 |
+
|
| 11 |
+
from . import package_streaming
|
| 12 |
+
|
| 13 |
+
if typing.TYPE_CHECKING: # pragma: no cover
|
| 14 |
+
from mypy_boto3_s3 import Client
|
| 15 |
+
from mypy_boto3_s3.type_defs import GetObjectOutputTypeDef
|
| 16 |
+
else:
|
| 17 |
+
Client = GetObjectOutputTypeDef = None
|
| 18 |
+
|
| 19 |
+
from .url import conda_reader_for_url
|
| 20 |
+
|
| 21 |
+
__all__ = ["stream_conda_info", "conda_reader_for_s3"]
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
class ResponseFacade:
|
| 25 |
+
def __init__(self, response: GetObjectOutputTypeDef):
|
| 26 |
+
self.response = response
|
| 27 |
+
self.raw: Any = response["Body"]
|
| 28 |
+
|
| 29 |
+
def raise_for_status(self):
|
| 30 |
+
# s3 get_object raises automatically?
|
| 31 |
+
pass
|
| 32 |
+
|
| 33 |
+
@property
|
| 34 |
+
def status_code(self):
|
| 35 |
+
return self.response["ResponseMetadata"]["HTTPStatusCode"]
|
| 36 |
+
|
| 37 |
+
@property
|
| 38 |
+
def headers(self):
|
| 39 |
+
# a case-sensitive dict; keys may be lowercased always?
|
| 40 |
+
return self.response["ResponseMetadata"]["HTTPHeaders"]
|
| 41 |
+
|
| 42 |
+
def iter_content(self, n: int):
|
| 43 |
+
return iter(lambda: self.raw.read(n), b"")
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
class SessionFacade:
|
| 47 |
+
"""
|
| 48 |
+
Make s3 client look just enough like a requests.session for LazyZipOverHTTP
|
| 49 |
+
"""
|
| 50 |
+
|
| 51 |
+
def __init__(self, client: Client, bucket: str, key: str):
|
| 52 |
+
self.client = client
|
| 53 |
+
self.bucket = bucket
|
| 54 |
+
self.key = key
|
| 55 |
+
|
| 56 |
+
def get(self, url, *, headers: dict | None = None, stream=True):
|
| 57 |
+
if headers and "Range" in headers:
|
| 58 |
+
response = self.client.get_object(
|
| 59 |
+
Bucket=self.bucket, Key=self.key, Range=headers["Range"]
|
| 60 |
+
)
|
| 61 |
+
else:
|
| 62 |
+
response = self.client.get_object(Bucket=self.bucket, Key=self.key)
|
| 63 |
+
return ResponseFacade(response)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def stream_conda_info(client, bucket, key):
|
| 67 |
+
"""
|
| 68 |
+
Yield (tar, member) for conda package.
|
| 69 |
+
|
| 70 |
+
Just "info/" for .conda, all members for tar.
|
| 71 |
+
"""
|
| 72 |
+
filename, conda = conda_reader_for_s3(client, bucket, key)
|
| 73 |
+
|
| 74 |
+
with closing(conda):
|
| 75 |
+
yield from package_streaming.stream_conda_info(filename, conda)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def conda_reader_for_s3(client: Client, bucket: str, key: str):
|
| 79 |
+
"""
|
| 80 |
+
Return (name, file_like) suitable for package_streaming APIs
|
| 81 |
+
"""
|
| 82 |
+
session: Any = SessionFacade(client, bucket, key)
|
| 83 |
+
return conda_reader_for_url(key, session)
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/transmute.py
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Convert .tar.bz2 to .conda
|
| 3 |
+
|
| 4 |
+
Uses ``tempfile.SpooledTemporaryFile`` to buffer ``pkg-*.tar`` and
|
| 5 |
+
``info-*.tar``, then compress directly into an open `ZipFile` at the end.
|
| 6 |
+
`SpooledTemporaryFile` buffers the first 10MB of the package and its metadata in
|
| 7 |
+
memory, but writes out to disk for larger packages.
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import os
|
| 13 |
+
import tarfile
|
| 14 |
+
from collections.abc import Iterator
|
| 15 |
+
from pathlib import Path
|
| 16 |
+
from typing import Callable
|
| 17 |
+
|
| 18 |
+
import zstandard
|
| 19 |
+
|
| 20 |
+
from .create import ZSTD_COMPRESS_LEVEL, ZSTD_COMPRESS_THREADS, conda_builder
|
| 21 |
+
|
| 22 |
+
# streams everything in .tar.bz2 mode
|
| 23 |
+
from .package_streaming import CondaComponent, stream_conda_component
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def transmute(
|
| 27 |
+
package,
|
| 28 |
+
path,
|
| 29 |
+
*,
|
| 30 |
+
compressor: Callable[
|
| 31 |
+
[], zstandard.ZstdCompressor
|
| 32 |
+
] = lambda: zstandard.ZstdCompressor(
|
| 33 |
+
level=ZSTD_COMPRESS_LEVEL, threads=ZSTD_COMPRESS_THREADS
|
| 34 |
+
),
|
| 35 |
+
is_info: Callable[[str], bool] = lambda filename: filename.startswith("info/"),
|
| 36 |
+
) -> Path:
|
| 37 |
+
"""
|
| 38 |
+
Convert .tar.bz2 conda package to .conda-format under path.
|
| 39 |
+
|
| 40 |
+
:param package: path to .tar.bz2 conda package
|
| 41 |
+
:param path: destination path for transmuted .conda package
|
| 42 |
+
:param compressor: A function that creates instances of
|
| 43 |
+
``zstandard.ZstdCompressor()`` to override defaults.
|
| 44 |
+
:param is_info: A function that returns True if a file belongs in the
|
| 45 |
+
``info`` component of a `.conda` package. ``conda-package-handling``
|
| 46 |
+
(not this package ``conda-package-streaming``) uses a set of regular
|
| 47 |
+
expressions to keep expected items in the info- component, while other
|
| 48 |
+
items starting with ``info/`` wind up in the pkg- component.
|
| 49 |
+
|
| 50 |
+
:return: Path to transmuted package.
|
| 51 |
+
"""
|
| 52 |
+
assert package.endswith(".tar.bz2"), "can only convert .tar.bz2 to .conda"
|
| 53 |
+
assert os.path.isdir(path)
|
| 54 |
+
stem = os.path.basename(package)[: -len(".tar.bz2")]
|
| 55 |
+
package_stream = stream_conda_component(package)
|
| 56 |
+
|
| 57 |
+
return transmute_stream(
|
| 58 |
+
stem,
|
| 59 |
+
path,
|
| 60 |
+
compressor=compressor,
|
| 61 |
+
is_info=is_info,
|
| 62 |
+
package_stream=package_stream,
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def transmute_stream(
|
| 67 |
+
stem,
|
| 68 |
+
path,
|
| 69 |
+
*,
|
| 70 |
+
compressor: Callable[
|
| 71 |
+
[], zstandard.ZstdCompressor
|
| 72 |
+
] = lambda: zstandard.ZstdCompressor(
|
| 73 |
+
level=ZSTD_COMPRESS_LEVEL, threads=ZSTD_COMPRESS_THREADS
|
| 74 |
+
),
|
| 75 |
+
is_info: Callable[[str], bool] = lambda filename: filename.startswith("info/"),
|
| 76 |
+
package_stream: Iterator[tuple[tarfile.TarFile, tarfile.TarInfo]],
|
| 77 |
+
):
|
| 78 |
+
"""
|
| 79 |
+
Convert (TarFile, TarInfo) iterator like those produced by
|
| 80 |
+
``stream_conda_component`` to .conda-format under path. Allows for more
|
| 81 |
+
creative data sources.
|
| 82 |
+
|
| 83 |
+
e.g. recompress ``.conda``:
|
| 84 |
+
|
| 85 |
+
.. code-block:: python
|
| 86 |
+
|
| 87 |
+
transmute_stream(..., package_stream=itertools.chain(
|
| 88 |
+
stream_conda_component("package.conda",
|
| 89 |
+
component=CondaComponent.pkg),
|
| 90 |
+
stream_conda_component("package.conda",
|
| 91 |
+
component=CondaComponent.info),
|
| 92 |
+
))
|
| 93 |
+
|
| 94 |
+
This example could move files between the ``pkg-`` and ``info-`` components
|
| 95 |
+
depending on the ``is_info`` function.
|
| 96 |
+
|
| 97 |
+
:param stem: output filename without extension
|
| 98 |
+
:param path: destination path for transmuted .conda package
|
| 99 |
+
:param compressor: A function that creates instances of
|
| 100 |
+
``zstandard.ZstdCompressor()`` to override defaults.
|
| 101 |
+
:param is_info: A function that returns True if a file belongs in the
|
| 102 |
+
``info`` component of a `.conda` package. ``conda-package-handling``
|
| 103 |
+
(not this package ``conda-package-streaming``) uses a set of regular
|
| 104 |
+
expressions to keep expected items in the info- component, while other
|
| 105 |
+
items starting with ``info/`` wind up in the pkg- component.
|
| 106 |
+
:param package_stream: Iterator of (Tarfile, TarInfo) tuples.
|
| 107 |
+
|
| 108 |
+
:return: Path to transmuted package.
|
| 109 |
+
"""
|
| 110 |
+
output_path = Path(path, f"{stem}.conda")
|
| 111 |
+
with conda_builder(stem, path, compressor=compressor, is_info=is_info) as conda_tar:
|
| 112 |
+
for tar, member in package_stream:
|
| 113 |
+
if member.isfile():
|
| 114 |
+
conda_tar.addfile(member, tar.extractfile(member))
|
| 115 |
+
else:
|
| 116 |
+
conda_tar.addfile(member)
|
| 117 |
+
|
| 118 |
+
return output_path
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
def transmute_tar_bz2(
|
| 122 |
+
package: str,
|
| 123 |
+
path,
|
| 124 |
+
) -> Path:
|
| 125 |
+
"""
|
| 126 |
+
Convert .conda package to .tar.bz2 format under path.
|
| 127 |
+
|
| 128 |
+
Can recompress .tar.bz2 packages.
|
| 129 |
+
|
| 130 |
+
Args:
|
| 131 |
+
package: path to .conda or .tar.bz2 package.
|
| 132 |
+
path: destination path for transmuted package.
|
| 133 |
+
|
| 134 |
+
Returns:
|
| 135 |
+
Path to transmuted package.
|
| 136 |
+
"""
|
| 137 |
+
assert package.endswith((".tar.bz2", ".conda")), "Unknown extension"
|
| 138 |
+
assert os.path.isdir(path)
|
| 139 |
+
|
| 140 |
+
incoming_format = ".conda" if package.endswith(".conda") else ".tar.bz2"
|
| 141 |
+
|
| 142 |
+
file_id = os.path.basename(package)[: -len(incoming_format)]
|
| 143 |
+
|
| 144 |
+
if incoming_format == ".conda":
|
| 145 |
+
# .tar.bz2 MUST place info/ first.
|
| 146 |
+
components = [CondaComponent.info, CondaComponent.pkg]
|
| 147 |
+
else:
|
| 148 |
+
# .tar.bz2 doesn't filter by component
|
| 149 |
+
components = [CondaComponent.pkg]
|
| 150 |
+
|
| 151 |
+
output_path = Path(path, f"{file_id}.tar.bz2")
|
| 152 |
+
|
| 153 |
+
with open(package, "rb") as fileobj, tarfile.open(output_path, "x:bz2") as pkg_tar:
|
| 154 |
+
for component in components:
|
| 155 |
+
stream = iter(stream_conda_component(package, fileobj, component=component))
|
| 156 |
+
for tar, member in stream:
|
| 157 |
+
if member.isfile():
|
| 158 |
+
pkg_tar.addfile(member, tar.extractfile(member))
|
| 159 |
+
else:
|
| 160 |
+
pkg_tar.addfile(member)
|
| 161 |
+
|
| 162 |
+
return output_path
|
miniconda3/lib/python3.13/site-packages/conda_package_streaming/url.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Fetch metadata from remote .conda or .tar.bz2 package.
|
| 3 |
+
|
| 4 |
+
Try to fetch less than the whole file if possible.
|
| 5 |
+
|
| 6 |
+
This module should only be used to make *partial* reads against a remote
|
| 7 |
+
package, typically just the ``info`` portion. If a full ``.conda`` format
|
| 8 |
+
package is needed, it is more efficient to download locally first and then use
|
| 9 |
+
the file-based API.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
import logging
|
| 13 |
+
import sys
|
| 14 |
+
import urllib.parse
|
| 15 |
+
from pathlib import Path
|
| 16 |
+
|
| 17 |
+
import requests
|
| 18 |
+
|
| 19 |
+
from . import package_streaming
|
| 20 |
+
|
| 21 |
+
# Excellent HTTP Range request file-like object
|
| 22 |
+
from .lazy_wheel import LazyConda
|
| 23 |
+
|
| 24 |
+
log = logging.getLogger(__name__)
|
| 25 |
+
|
| 26 |
+
session = requests.Session()
|
| 27 |
+
session.headers["User-Agent"] = "conda-package-streaming/0.1.0"
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
METADATA_CHECKLIST = frozenset({"info/index.json", "info/recipe/meta.yaml"})
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def extract_conda_info(url, destdir, checklist=METADATA_CHECKLIST, session=session):
|
| 34 |
+
"""
|
| 35 |
+
Extract info/index.json and info/recipe/meta.yaml from url to destdir; close
|
| 36 |
+
url as soon as those files are found.
|
| 37 |
+
"""
|
| 38 |
+
checklist = set(checklist)
|
| 39 |
+
stream = stream_conda_info(url, session=session)
|
| 40 |
+
for tar, member in stream:
|
| 41 |
+
if member.name in checklist:
|
| 42 |
+
tar.extract(member, destdir)
|
| 43 |
+
checklist.remove(member.name)
|
| 44 |
+
if not checklist:
|
| 45 |
+
stream.close()
|
| 46 |
+
# next iteraton of for loop raises GeneratorExit in stream
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def stream_conda_info(url, session=session):
|
| 50 |
+
"""
|
| 51 |
+
Yield (tar, member) for conda package at url
|
| 52 |
+
|
| 53 |
+
Just "info/" for .conda, all members for tar.
|
| 54 |
+
"""
|
| 55 |
+
filename, conda = conda_reader_for_url(url, session=session)
|
| 56 |
+
|
| 57 |
+
try:
|
| 58 |
+
yield from package_streaming.stream_conda_info(filename, conda)
|
| 59 |
+
finally:
|
| 60 |
+
if hasattr(conda, "release_conn"):
|
| 61 |
+
# For .tar.bz2. Take extra care to drop connections after we are
|
| 62 |
+
# done reading a partial response.
|
| 63 |
+
conda.release_conn()
|
| 64 |
+
conda.close()
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def conda_reader_for_url(
|
| 68 |
+
url, session: requests.Session = session, fall_back_to_full_download: bool = False
|
| 69 |
+
):
|
| 70 |
+
"""
|
| 71 |
+
Return (name, file_like) suitable for package_streaming APIs
|
| 72 |
+
|
| 73 |
+
:param url: URL to conda package
|
| 74 |
+
:param session: The session to use for web requests.
|
| 75 |
+
:param fall_back_to_full_download: If true, fall back to downloading the entire
|
| 76 |
+
package instead of streaming it in the case of a specific issue where the server
|
| 77 |
+
incorrectly responds with 416 (Range Not Satisfiable). See LazyZipOverHTTP for
|
| 78 |
+
more details.
|
| 79 |
+
"""
|
| 80 |
+
parsed_url = urllib.parse.urlparse(url)
|
| 81 |
+
*_, filename = parsed_url.path.rsplit("/", 1)
|
| 82 |
+
if filename.endswith(".conda"):
|
| 83 |
+
file_id = filename[: -len(".conda")]
|
| 84 |
+
conda = LazyConda(
|
| 85 |
+
url, session, fall_back_to_full_download=fall_back_to_full_download
|
| 86 |
+
)
|
| 87 |
+
conda.prefetch(file_id)
|
| 88 |
+
elif filename.endswith(".tar.bz2"):
|
| 89 |
+
response = session.get(url, stream=True, headers={"Connection": "close"})
|
| 90 |
+
conda = response.raw
|
| 91 |
+
else:
|
| 92 |
+
raise ValueError("Unsupported extension %s", url)
|
| 93 |
+
return filename, conda
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
if __name__ == "__main__": # pragma: no cover
|
| 97 |
+
import logging
|
| 98 |
+
|
| 99 |
+
logging.basicConfig(level=logging.DEBUG)
|
| 100 |
+
extract_conda_info(sys.argv[1], Path(sys.argv[2]).absolute())
|
miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/METADATA
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: cryptography
|
| 3 |
+
Version: 46.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.8
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.14
|
| 22 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 23 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 24 |
+
Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable
|
| 25 |
+
Classifier: Topic :: Security :: Cryptography
|
| 26 |
+
Requires-Dist: cffi>=1.14 ; python_full_version == '3.8.*' and platform_python_implementation != 'PyPy'
|
| 27 |
+
Requires-Dist: cffi>=2.0.0 ; python_full_version >= '3.9' and platform_python_implementation != 'PyPy'
|
| 28 |
+
Requires-Dist: typing-extensions>=4.13.2 ; python_full_version < '3.11'
|
| 29 |
+
Requires-Dist: sphinx>=5.3.0 ; extra == 'docs'
|
| 30 |
+
Requires-Dist: sphinx-rtd-theme>=3.0.0 ; extra == 'docs'
|
| 31 |
+
Requires-Dist: sphinx-inline-tabs ; extra == 'docs'
|
| 32 |
+
Requires-Dist: pyenchant>=3 ; extra == 'docstest'
|
| 33 |
+
Requires-Dist: readme-renderer>=30.0 ; extra == 'docstest'
|
| 34 |
+
Requires-Dist: sphinxcontrib-spelling>=7.3.1 ; extra == 'docstest'
|
| 35 |
+
Requires-Dist: nox[uv]>=2024.4.15 ; extra == 'nox'
|
| 36 |
+
Requires-Dist: ruff>=0.11.11 ; extra == 'pep8test'
|
| 37 |
+
Requires-Dist: mypy>=1.14 ; extra == 'pep8test'
|
| 38 |
+
Requires-Dist: check-sdist ; extra == 'pep8test'
|
| 39 |
+
Requires-Dist: click>=8.0.1 ; extra == 'pep8test'
|
| 40 |
+
Requires-Dist: build>=1.0.0 ; extra == 'sdist'
|
| 41 |
+
Requires-Dist: bcrypt>=3.1.5 ; extra == 'ssh'
|
| 42 |
+
Requires-Dist: cryptography-vectors==46.0.5 ; extra == 'test'
|
| 43 |
+
Requires-Dist: pytest>=7.4.0 ; extra == 'test'
|
| 44 |
+
Requires-Dist: pytest-benchmark>=4.0 ; extra == 'test'
|
| 45 |
+
Requires-Dist: pytest-cov>=2.10.1 ; extra == 'test'
|
| 46 |
+
Requires-Dist: pytest-xdist>=3.5.0 ; extra == 'test'
|
| 47 |
+
Requires-Dist: pretend>=0.7 ; extra == 'test'
|
| 48 |
+
Requires-Dist: certifi>=2024 ; extra == 'test'
|
| 49 |
+
Requires-Dist: pytest-randomly ; extra == 'test-randomorder'
|
| 50 |
+
Provides-Extra: docs
|
| 51 |
+
Provides-Extra: docstest
|
| 52 |
+
Provides-Extra: nox
|
| 53 |
+
Provides-Extra: pep8test
|
| 54 |
+
Provides-Extra: sdist
|
| 55 |
+
Provides-Extra: ssh
|
| 56 |
+
Provides-Extra: test
|
| 57 |
+
Provides-Extra: test-randomorder
|
| 58 |
+
License-File: LICENSE
|
| 59 |
+
License-File: LICENSE.APACHE
|
| 60 |
+
License-File: LICENSE.BSD
|
| 61 |
+
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
|
| 62 |
+
Author-email: The Python Cryptographic Authority and individual contributors <cryptography-dev@python.org>
|
| 63 |
+
License-Expression: Apache-2.0 OR BSD-3-Clause
|
| 64 |
+
Requires-Python: >=3.8, !=3.9.0, !=3.9.1
|
| 65 |
+
Description-Content-Type: text/x-rst; charset=UTF-8
|
| 66 |
+
Project-URL: changelog, https://cryptography.io/en/latest/changelog/
|
| 67 |
+
Project-URL: documentation, https://cryptography.io/
|
| 68 |
+
Project-URL: homepage, https://github.com/pyca/cryptography
|
| 69 |
+
Project-URL: issues, https://github.com/pyca/cryptography/issues
|
| 70 |
+
Project-URL: source, https://github.com/pyca/cryptography/
|
| 71 |
+
|
| 72 |
+
pyca/cryptography
|
| 73 |
+
=================
|
| 74 |
+
|
| 75 |
+
.. image:: https://img.shields.io/pypi/v/cryptography.svg
|
| 76 |
+
:target: https://pypi.org/project/cryptography/
|
| 77 |
+
:alt: Latest Version
|
| 78 |
+
|
| 79 |
+
.. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest
|
| 80 |
+
:target: https://cryptography.io
|
| 81 |
+
:alt: Latest Docs
|
| 82 |
+
|
| 83 |
+
.. image:: https://github.com/pyca/cryptography/actions/workflows/ci.yml/badge.svg
|
| 84 |
+
:target: https://github.com/pyca/cryptography/actions/workflows/ci.yml?query=branch%3Amain
|
| 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.8+ 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 |
+
|
miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/RECORD
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cryptography-46.0.5.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
cryptography-46.0.5.dist-info/METADATA,sha256=p5LozbTBtaE0kjWTceUsqAM-uyB-WVbiFji7RXpzzpE,5748
|
| 3 |
+
cryptography-46.0.5.dist-info/RECORD,,
|
| 4 |
+
cryptography-46.0.5.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 5 |
+
cryptography-46.0.5.dist-info/WHEEL,sha256=cyD-4T7RQHgO12DUEFwAZAE61yBu0epJyI7tq0T7IUU,99
|
| 6 |
+
cryptography-46.0.5.dist-info/direct_url.json,sha256=E9VjsRq187Ay5OEfC7MfqeDfofaDlEhllpzF37fMVcc,104
|
| 7 |
+
cryptography-46.0.5.dist-info/licenses/LICENSE,sha256=Pgx8CRqUi4JTO6mP18u0BDLW8amsv4X1ki0vmak65rs,197
|
| 8 |
+
cryptography-46.0.5.dist-info/licenses/LICENSE.APACHE,sha256=qsc7MUj20dcRHbyjIJn2jSbGRMaBOuHk8F9leaomY_4,11360
|
| 9 |
+
cryptography-46.0.5.dist-info/licenses/LICENSE.BSD,sha256=YCxMdILeZHndLpeTzaJ15eY9dz2s0eymiSMqtwCPtPs,1532
|
| 10 |
+
cryptography/__about__.py,sha256=GWg4NAxg4vsSKUwmDy1HjUeAOhqTA46wIhiY6i03NSU,445
|
| 11 |
+
cryptography/__init__.py,sha256=mthuUrTd4FROCpUYrTIqhjz6s6T9djAZrV7nZ1oMm2o,364
|
| 12 |
+
cryptography/__pycache__/__about__.cpython-313.pyc,,
|
| 13 |
+
cryptography/__pycache__/__init__.cpython-313.pyc,,
|
| 14 |
+
cryptography/__pycache__/exceptions.cpython-313.pyc,,
|
| 15 |
+
cryptography/__pycache__/fernet.cpython-313.pyc,,
|
| 16 |
+
cryptography/__pycache__/utils.cpython-313.pyc,,
|
| 17 |
+
cryptography/exceptions.py,sha256=835EWILc2fwxw-gyFMriciC2SqhViETB10LBSytnDIc,1087
|
| 18 |
+
cryptography/fernet.py,sha256=3Cvxkh0KJSbX8HbnCHu4wfCW7U0GgfUA3v_qQ8a8iWc,6963
|
| 19 |
+
cryptography/hazmat/__init__.py,sha256=5IwrLWrVp0AjEr_4FdWG_V057NSJGY_W4egNNsuct0g,455
|
| 20 |
+
cryptography/hazmat/__pycache__/__init__.cpython-313.pyc,,
|
| 21 |
+
cryptography/hazmat/__pycache__/_oid.cpython-313.pyc,,
|
| 22 |
+
cryptography/hazmat/_oid.py,sha256=p8ThjwJB56Ci_rAIrjyJ1f8VjgD6e39es2dh8JIUBOw,17240
|
| 23 |
+
cryptography/hazmat/asn1/__init__.py,sha256=hS_EWx3wVvZzfbCcNV8hzcDnyMM8H-BhIoS1TipUosk,293
|
| 24 |
+
cryptography/hazmat/asn1/__pycache__/__init__.cpython-313.pyc,,
|
| 25 |
+
cryptography/hazmat/asn1/__pycache__/asn1.cpython-313.pyc,,
|
| 26 |
+
cryptography/hazmat/asn1/asn1.py,sha256=eMEThEXa19LQjcyVofgHsW6tsZnjp3ddH7bWkkcxfLM,3860
|
| 27 |
+
cryptography/hazmat/backends/__init__.py,sha256=O5jvKFQdZnXhKeqJ-HtulaEL9Ni7mr1mDzZY5kHlYhI,361
|
| 28 |
+
cryptography/hazmat/backends/__pycache__/__init__.cpython-313.pyc,,
|
| 29 |
+
cryptography/hazmat/backends/openssl/__init__.py,sha256=p3jmJfnCag9iE5sdMrN6VvVEu55u46xaS_IjoI0SrmA,305
|
| 30 |
+
cryptography/hazmat/backends/openssl/__pycache__/__init__.cpython-313.pyc,,
|
| 31 |
+
cryptography/hazmat/backends/openssl/__pycache__/backend.cpython-313.pyc,,
|
| 32 |
+
cryptography/hazmat/backends/openssl/backend.py,sha256=tV5AxBoFJ2GfA0DMWSY-0TxQJrpQoexzI9R4Kybb--4,10215
|
| 33 |
+
cryptography/hazmat/bindings/__init__.py,sha256=s9oKCQ2ycFdXoERdS1imafueSkBsL9kvbyfghaauZ9Y,180
|
| 34 |
+
cryptography/hazmat/bindings/__pycache__/__init__.cpython-313.pyc,,
|
| 35 |
+
cryptography/hazmat/bindings/_rust.abi3.so,sha256=v4i_FkVhfTY8Injr-EjGsmRefofnuLLTBplffI0inDs,5194896
|
| 36 |
+
cryptography/hazmat/bindings/_rust/__init__.pyi,sha256=KhqLhXFPArPzzJ7DYO9Fl8FoXB_BagAd_r4Dm_Ze9Xo,1257
|
| 37 |
+
cryptography/hazmat/bindings/_rust/_openssl.pyi,sha256=mpNJLuYLbCVrd5i33FBTmWwL_55Dw7JPkSLlSX9Q7oI,230
|
| 38 |
+
cryptography/hazmat/bindings/_rust/asn1.pyi,sha256=BrGjC8J6nwuS-r3EVcdXJB8ndotfY9mbQYOfpbPG0HA,354
|
| 39 |
+
cryptography/hazmat/bindings/_rust/declarative_asn1.pyi,sha256=2ECFmYue1EPkHEE2Bm7aLwkjB0mSUTpr23v9MN4pri4,892
|
| 40 |
+
cryptography/hazmat/bindings/_rust/exceptions.pyi,sha256=exXr2xw_0pB1kk93cYbM3MohbzoUkjOms1ZMUi0uQZE,640
|
| 41 |
+
cryptography/hazmat/bindings/_rust/ocsp.pyi,sha256=VPVWuKHI9EMs09ZLRYAGvR0Iz0mCMmEzXAkgJHovpoM,4020
|
| 42 |
+
cryptography/hazmat/bindings/_rust/openssl/__init__.pyi,sha256=iOAMDyHoNwwCSZfZzuXDr64g4GpGUeDgEN-LjXqdrBM,1522
|
| 43 |
+
cryptography/hazmat/bindings/_rust/openssl/aead.pyi,sha256=4Nddw6-ynzIB3w2W86WvkGKTLlTDk_6F5l54RHCuy3E,2688
|
| 44 |
+
cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi,sha256=LhPzHWSXJq4grAJXn6zSvSSdV-aYIIscHDwIPlJGGPs,1315
|
| 45 |
+
cryptography/hazmat/bindings/_rust/openssl/cmac.pyi,sha256=nPH0X57RYpsAkRowVpjQiHE566ThUTx7YXrsadmrmHk,564
|
| 46 |
+
cryptography/hazmat/bindings/_rust/openssl/dh.pyi,sha256=Z3TC-G04-THtSdAOPLM1h2G7ml5bda1ElZUcn5wpuhk,1564
|
| 47 |
+
cryptography/hazmat/bindings/_rust/openssl/dsa.pyi,sha256=qBtkgj2albt2qFcnZ9UDrhzoNhCVO7HTby5VSf1EXMI,1299
|
| 48 |
+
cryptography/hazmat/bindings/_rust/openssl/ec.pyi,sha256=zJy0pRa5n-_p2dm45PxECB_-B6SVZyNKfjxFDpPqT38,1691
|
| 49 |
+
cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi,sha256=VXfXd5G6hUivg399R1DYdmW3eTb0EebzDTqjRC2gaRw,532
|
| 50 |
+
cryptography/hazmat/bindings/_rust/openssl/ed448.pyi,sha256=Yx49lqdnjsD7bxiDV1kcaMrDktug5evi5a6zerMiy2s,514
|
| 51 |
+
cryptography/hazmat/bindings/_rust/openssl/hashes.pyi,sha256=OWZvBx7xfo_HJl41Nc--DugVyCVPIprZ3HlOPTSWH9g,984
|
| 52 |
+
cryptography/hazmat/bindings/_rust/openssl/hmac.pyi,sha256=BXZn7NDjL3JAbYW0SQ8pg1iyC5DbQXVhUAiwsi8DFR8,702
|
| 53 |
+
cryptography/hazmat/bindings/_rust/openssl/kdf.pyi,sha256=xXfFBb9QehHfDtEaxV_65Z0YK7NquOVIChpTLkgAs_k,2029
|
| 54 |
+
cryptography/hazmat/bindings/_rust/openssl/keys.pyi,sha256=teIt8M6ZEMJrn4s3W0UnW0DZ-30Jd68WnSsKKG124l0,912
|
| 55 |
+
cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi,sha256=_SW9NtQ5FDlAbdclFtWpT4lGmxKIKHpN-4j8J2BzYfQ,585
|
| 56 |
+
cryptography/hazmat/bindings/_rust/openssl/rsa.pyi,sha256=2OQCNSXkxgc-3uw1xiCCloIQTV6p9_kK79Yu0rhZgPc,1364
|
| 57 |
+
cryptography/hazmat/bindings/_rust/openssl/x25519.pyi,sha256=ewn4GpQyb7zPwE-ni7GtyQgMC0A1mLuqYsSyqv6nI_s,523
|
| 58 |
+
cryptography/hazmat/bindings/_rust/openssl/x448.pyi,sha256=juTZTmli8jO_5Vcufg-vHvx_tCyezmSLIh_9PU3TczI,505
|
| 59 |
+
cryptography/hazmat/bindings/_rust/pkcs12.pyi,sha256=vEEd5wDiZvb8ZGFaziLCaWLzAwoG_tvPUxLQw5_uOl8,1605
|
| 60 |
+
cryptography/hazmat/bindings/_rust/pkcs7.pyi,sha256=txGBJijqZshEcqra6byPNbnisIdlxzOSIHP2hl9arPs,1601
|
| 61 |
+
cryptography/hazmat/bindings/_rust/test_support.pyi,sha256=PPhld-WkO743iXFPebeG0LtgK0aTzGdjcIsay1Gm5GE,757
|
| 62 |
+
cryptography/hazmat/bindings/_rust/x509.pyi,sha256=n9X0IQ6ICbdIi-ExdCFZoBgeY6njm3QOVAVZwDQdnbk,9784
|
| 63 |
+
cryptography/hazmat/bindings/openssl/__init__.py,sha256=s9oKCQ2ycFdXoERdS1imafueSkBsL9kvbyfghaauZ9Y,180
|
| 64 |
+
cryptography/hazmat/bindings/openssl/__pycache__/__init__.cpython-313.pyc,,
|
| 65 |
+
cryptography/hazmat/bindings/openssl/__pycache__/_conditional.cpython-313.pyc,,
|
| 66 |
+
cryptography/hazmat/bindings/openssl/__pycache__/binding.cpython-313.pyc,,
|
| 67 |
+
cryptography/hazmat/bindings/openssl/_conditional.py,sha256=DMOpA_XN4l70zTc5_J9DpwlbQeUBRTWpfIJ4yRIn1-U,5791
|
| 68 |
+
cryptography/hazmat/bindings/openssl/binding.py,sha256=x8eocEmukO4cm7cHqfVmOoYY7CCXdoF1v1WhZQt9neo,4610
|
| 69 |
+
cryptography/hazmat/decrepit/__init__.py,sha256=wHCbWfaefa-fk6THSw9th9fJUsStJo7245wfFBqmduA,216
|
| 70 |
+
cryptography/hazmat/decrepit/__pycache__/__init__.cpython-313.pyc,,
|
| 71 |
+
cryptography/hazmat/decrepit/ciphers/__init__.py,sha256=wHCbWfaefa-fk6THSw9th9fJUsStJo7245wfFBqmduA,216
|
| 72 |
+
cryptography/hazmat/decrepit/ciphers/__pycache__/__init__.cpython-313.pyc,,
|
| 73 |
+
cryptography/hazmat/decrepit/ciphers/__pycache__/algorithms.cpython-313.pyc,,
|
| 74 |
+
cryptography/hazmat/decrepit/ciphers/algorithms.py,sha256=YrKgHS4MfwWaMmPBYRymRRlC0phwWp9ycICFezeJPGk,2595
|
| 75 |
+
cryptography/hazmat/primitives/__init__.py,sha256=s9oKCQ2ycFdXoERdS1imafueSkBsL9kvbyfghaauZ9Y,180
|
| 76 |
+
cryptography/hazmat/primitives/__pycache__/__init__.cpython-313.pyc,,
|
| 77 |
+
cryptography/hazmat/primitives/__pycache__/_asymmetric.cpython-313.pyc,,
|
| 78 |
+
cryptography/hazmat/primitives/__pycache__/_cipheralgorithm.cpython-313.pyc,,
|
| 79 |
+
cryptography/hazmat/primitives/__pycache__/_serialization.cpython-313.pyc,,
|
| 80 |
+
cryptography/hazmat/primitives/__pycache__/cmac.cpython-313.pyc,,
|
| 81 |
+
cryptography/hazmat/primitives/__pycache__/constant_time.cpython-313.pyc,,
|
| 82 |
+
cryptography/hazmat/primitives/__pycache__/hashes.cpython-313.pyc,,
|
| 83 |
+
cryptography/hazmat/primitives/__pycache__/hmac.cpython-313.pyc,,
|
| 84 |
+
cryptography/hazmat/primitives/__pycache__/keywrap.cpython-313.pyc,,
|
| 85 |
+
cryptography/hazmat/primitives/__pycache__/padding.cpython-313.pyc,,
|
| 86 |
+
cryptography/hazmat/primitives/__pycache__/poly1305.cpython-313.pyc,,
|
| 87 |
+
cryptography/hazmat/primitives/_asymmetric.py,sha256=RhgcouUB6HTiFDBrR1LxqkMjpUxIiNvQ1r_zJjRG6qQ,532
|
| 88 |
+
cryptography/hazmat/primitives/_cipheralgorithm.py,sha256=Eh3i7lwedHfi0eLSsH93PZxQKzY9I6lkK67vL4V5tOc,1522
|
| 89 |
+
cryptography/hazmat/primitives/_serialization.py,sha256=chgPCSF2jxI2Cr5gB-qbWXOvOfupBh4CARS0KAhv9AM,5123
|
| 90 |
+
cryptography/hazmat/primitives/asymmetric/__init__.py,sha256=s9oKCQ2ycFdXoERdS1imafueSkBsL9kvbyfghaauZ9Y,180
|
| 91 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/__init__.cpython-313.pyc,,
|
| 92 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/dh.cpython-313.pyc,,
|
| 93 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/dsa.cpython-313.pyc,,
|
| 94 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/ec.cpython-313.pyc,,
|
| 95 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/ed25519.cpython-313.pyc,,
|
| 96 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/ed448.cpython-313.pyc,,
|
| 97 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/padding.cpython-313.pyc,,
|
| 98 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/rsa.cpython-313.pyc,,
|
| 99 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/types.cpython-313.pyc,,
|
| 100 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/utils.cpython-313.pyc,,
|
| 101 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/x25519.cpython-313.pyc,,
|
| 102 |
+
cryptography/hazmat/primitives/asymmetric/__pycache__/x448.cpython-313.pyc,,
|
| 103 |
+
cryptography/hazmat/primitives/asymmetric/dh.py,sha256=0v_vEFFz5pQ1QG-FkWDyvgv7IfuVZSH5Q6LyFI5A8rg,3645
|
| 104 |
+
cryptography/hazmat/primitives/asymmetric/dsa.py,sha256=Ld_bbbqQFz12dObHxIkzEQzX0SWWP41RLSWkYSaKhqE,4213
|
| 105 |
+
cryptography/hazmat/primitives/asymmetric/ec.py,sha256=dj0ZR_jTVI1wojjipjbXNVccPSIRObWxSZcTGQKGbHc,13437
|
| 106 |
+
cryptography/hazmat/primitives/asymmetric/ed25519.py,sha256=jZW5cs472wXXV3eB0sE1b8w64gdazwwU0_MT5UOTiXs,3700
|
| 107 |
+
cryptography/hazmat/primitives/asymmetric/ed448.py,sha256=yAetgn2f2JYf0BO8MapGzXeThsvSMG5LmUCrxVOidAA,3729
|
| 108 |
+
cryptography/hazmat/primitives/asymmetric/padding.py,sha256=vQ6l6gOg9HqcbOsvHrSiJRVLdEj9L4m4HkRGYziTyFA,2854
|
| 109 |
+
cryptography/hazmat/primitives/asymmetric/rsa.py,sha256=ZnKOo2f34MCCOupC03Y1uR-_jiSG5IrelHEmxaME3D4,8303
|
| 110 |
+
cryptography/hazmat/primitives/asymmetric/types.py,sha256=LnsOJym-wmPUJ7Knu_7bCNU3kIiELCd6krOaW_JU08I,2996
|
| 111 |
+
cryptography/hazmat/primitives/asymmetric/utils.py,sha256=DPTs6T4F-UhwzFQTh-1fSEpQzazH2jf2xpIro3ItF4o,790
|
| 112 |
+
cryptography/hazmat/primitives/asymmetric/x25519.py,sha256=_4nQeZ3yJ3Lg0RpXnaqA-1yt6vbx1F-wzLcaZHwSpeE,3613
|
| 113 |
+
cryptography/hazmat/primitives/asymmetric/x448.py,sha256=WKBLtuVfJqiBRro654fGaQAlvsKbqbNkK7c4A_ZCdV0,3642
|
| 114 |
+
cryptography/hazmat/primitives/ciphers/__init__.py,sha256=eyEXmjk6_CZXaOPYDr7vAYGXr29QvzgWL2-4CSolLFs,680
|
| 115 |
+
cryptography/hazmat/primitives/ciphers/__pycache__/__init__.cpython-313.pyc,,
|
| 116 |
+
cryptography/hazmat/primitives/ciphers/__pycache__/aead.cpython-313.pyc,,
|
| 117 |
+
cryptography/hazmat/primitives/ciphers/__pycache__/algorithms.cpython-313.pyc,,
|
| 118 |
+
cryptography/hazmat/primitives/ciphers/__pycache__/base.cpython-313.pyc,,
|
| 119 |
+
cryptography/hazmat/primitives/ciphers/__pycache__/modes.cpython-313.pyc,,
|
| 120 |
+
cryptography/hazmat/primitives/ciphers/aead.py,sha256=Fzlyx7w8KYQakzDp1zWgJnIr62zgZrgVh1u2h4exB54,634
|
| 121 |
+
cryptography/hazmat/primitives/ciphers/algorithms.py,sha256=Q7ZJwcsx83Mgxv5y7r6CyJKSdsOwC-my-5A67-ma2vw,3407
|
| 122 |
+
cryptography/hazmat/primitives/ciphers/base.py,sha256=aBC7HHBBoixebmparVr0UlODs3VD0A7B6oz_AaRjDv8,4253
|
| 123 |
+
cryptography/hazmat/primitives/ciphers/modes.py,sha256=20stpwhDtbAvpH0SMf9EDHIciwmTF-JMBUOZ9bU8WiQ,8318
|
| 124 |
+
cryptography/hazmat/primitives/cmac.py,sha256=sz_s6H_cYnOvx-VNWdIKhRhe3Ymp8z8J0D3CBqOX3gg,338
|
| 125 |
+
cryptography/hazmat/primitives/constant_time.py,sha256=xdunWT0nf8OvKdcqUhhlFKayGp4_PgVJRU2W1wLSr_A,422
|
| 126 |
+
cryptography/hazmat/primitives/hashes.py,sha256=M8BrlKB3U6DEtHvWTV5VRjpteHv1kS3Zxm_Bsk04cr8,5184
|
| 127 |
+
cryptography/hazmat/primitives/hmac.py,sha256=RpB3z9z5skirCQrm7zQbtnp9pLMnAjrlTUvKqF5aDDc,423
|
| 128 |
+
cryptography/hazmat/primitives/kdf/__init__.py,sha256=4XibZnrYq4hh5xBjWiIXzaYW6FKx8hPbVaa_cB9zS64,750
|
| 129 |
+
cryptography/hazmat/primitives/kdf/__pycache__/__init__.cpython-313.pyc,,
|
| 130 |
+
cryptography/hazmat/primitives/kdf/__pycache__/argon2.cpython-313.pyc,,
|
| 131 |
+
cryptography/hazmat/primitives/kdf/__pycache__/concatkdf.cpython-313.pyc,,
|
| 132 |
+
cryptography/hazmat/primitives/kdf/__pycache__/hkdf.cpython-313.pyc,,
|
| 133 |
+
cryptography/hazmat/primitives/kdf/__pycache__/kbkdf.cpython-313.pyc,,
|
| 134 |
+
cryptography/hazmat/primitives/kdf/__pycache__/pbkdf2.cpython-313.pyc,,
|
| 135 |
+
cryptography/hazmat/primitives/kdf/__pycache__/scrypt.cpython-313.pyc,,
|
| 136 |
+
cryptography/hazmat/primitives/kdf/__pycache__/x963kdf.cpython-313.pyc,,
|
| 137 |
+
cryptography/hazmat/primitives/kdf/argon2.py,sha256=UFDNXG0v-rw3DqAQTB1UQAsQC2M5Ejg0k_6OCyhLKus,460
|
| 138 |
+
cryptography/hazmat/primitives/kdf/concatkdf.py,sha256=Ua8KoLXXnzgsrAUmHpyKymaPt8aPRP0EHEaBz7QCQ9I,3737
|
| 139 |
+
cryptography/hazmat/primitives/kdf/hkdf.py,sha256=M0lAEfRoc4kpp4-nwDj9yB-vNZukIOYEQrUlWsBNn9o,543
|
| 140 |
+
cryptography/hazmat/primitives/kdf/kbkdf.py,sha256=oZepvo4evhKkkJQWRDwaPoIbyTaFmDc5NPimxg6lfKg,9165
|
| 141 |
+
cryptography/hazmat/primitives/kdf/pbkdf2.py,sha256=1WIwhELR0w8ztTpTu8BrFiYWmK3hUfJq08I79TxwieE,1957
|
| 142 |
+
cryptography/hazmat/primitives/kdf/scrypt.py,sha256=XyWUdUUmhuI9V6TqAPOvujCSMGv1XQdg0a21IWCmO-U,590
|
| 143 |
+
cryptography/hazmat/primitives/kdf/x963kdf.py,sha256=zLTcF665QFvXX2f8TS7fmBZTteXpFjKahzfjjQcCJyw,1999
|
| 144 |
+
cryptography/hazmat/primitives/keywrap.py,sha256=XV4Pj2fqSeD-RqZVvY2cA3j5_7RwJSFygYuLfk2ujCo,5650
|
| 145 |
+
cryptography/hazmat/primitives/padding.py,sha256=QT-U-NvV2eQGO1wVPbDiNGNSc9keRDS-ig5cQOrLz0E,1865
|
| 146 |
+
cryptography/hazmat/primitives/poly1305.py,sha256=P5EPQV-RB_FJPahpg01u0Ts4S_PnAmsroxIGXbGeRRo,355
|
| 147 |
+
cryptography/hazmat/primitives/serialization/__init__.py,sha256=Q7uTgDlt7n3WfsMT6jYwutC6DIg_7SEeoAm1GHZ5B5E,1705
|
| 148 |
+
cryptography/hazmat/primitives/serialization/__pycache__/__init__.cpython-313.pyc,,
|
| 149 |
+
cryptography/hazmat/primitives/serialization/__pycache__/base.cpython-313.pyc,,
|
| 150 |
+
cryptography/hazmat/primitives/serialization/__pycache__/pkcs12.cpython-313.pyc,,
|
| 151 |
+
cryptography/hazmat/primitives/serialization/__pycache__/pkcs7.cpython-313.pyc,,
|
| 152 |
+
cryptography/hazmat/primitives/serialization/__pycache__/ssh.cpython-313.pyc,,
|
| 153 |
+
cryptography/hazmat/primitives/serialization/base.py,sha256=ikq5MJIwp_oUnjiaBco_PmQwOTYuGi-XkYUYHKy8Vo0,615
|
| 154 |
+
cryptography/hazmat/primitives/serialization/pkcs12.py,sha256=mS9cFNG4afzvseoc5e1MWoY2VskfL8N8Y_OFjl67luY,5104
|
| 155 |
+
cryptography/hazmat/primitives/serialization/pkcs7.py,sha256=5OR_Tkysxaprn4FegvJIfbep9rJ9wok6FLWvWwQ5-Mg,13943
|
| 156 |
+
cryptography/hazmat/primitives/serialization/ssh.py,sha256=hPV5obFznz0QhFfXFPOeQ8y6MsurA0xVMQiLnLESEs8,53700
|
| 157 |
+
cryptography/hazmat/primitives/twofactor/__init__.py,sha256=tmMZGB-g4IU1r7lIFqASU019zr0uPp_wEBYcwdDCKCA,258
|
| 158 |
+
cryptography/hazmat/primitives/twofactor/__pycache__/__init__.cpython-313.pyc,,
|
| 159 |
+
cryptography/hazmat/primitives/twofactor/__pycache__/hotp.cpython-313.pyc,,
|
| 160 |
+
cryptography/hazmat/primitives/twofactor/__pycache__/totp.cpython-313.pyc,,
|
| 161 |
+
cryptography/hazmat/primitives/twofactor/hotp.py,sha256=ivZo5BrcCGWLsqql4nZV0XXCjyGPi_iHfDFltGlOJwk,3256
|
| 162 |
+
cryptography/hazmat/primitives/twofactor/totp.py,sha256=m5LPpRL00kp4zY8gTjr55Hfz9aMlPS53kHmVkSQCmdY,1652
|
| 163 |
+
cryptography/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 164 |
+
cryptography/utils.py,sha256=nFHkPQZycOQGeBtBRkWSA4WjOHFo7pwummQt-PPSkZc,4349
|
| 165 |
+
cryptography/x509/__init__.py,sha256=xloN0swseNx-m2WFZmCA17gOoxQWqeU82UVjEdJBePQ,8257
|
| 166 |
+
cryptography/x509/__pycache__/__init__.cpython-313.pyc,,
|
| 167 |
+
cryptography/x509/__pycache__/base.cpython-313.pyc,,
|
| 168 |
+
cryptography/x509/__pycache__/certificate_transparency.cpython-313.pyc,,
|
| 169 |
+
cryptography/x509/__pycache__/extensions.cpython-313.pyc,,
|
| 170 |
+
cryptography/x509/__pycache__/general_name.cpython-313.pyc,,
|
| 171 |
+
cryptography/x509/__pycache__/name.cpython-313.pyc,,
|
| 172 |
+
cryptography/x509/__pycache__/ocsp.cpython-313.pyc,,
|
| 173 |
+
cryptography/x509/__pycache__/oid.cpython-313.pyc,,
|
| 174 |
+
cryptography/x509/__pycache__/verification.cpython-313.pyc,,
|
| 175 |
+
cryptography/x509/base.py,sha256=OrmTw3y8B6AE_nGXQPN8x9kq-d7rDWeH13gCq6T6D6U,27997
|
| 176 |
+
cryptography/x509/certificate_transparency.py,sha256=JqoOIDhlwInrYMFW6IFn77WJ0viF-PB_rlZV3vs9MYc,797
|
| 177 |
+
cryptography/x509/extensions.py,sha256=QxYrqR6SF1qzR9ZraP8wDiIczlEVlAFuwDRVcltB6Tk,77724
|
| 178 |
+
cryptography/x509/general_name.py,sha256=sP_rV11Qlpsk4x3XXGJY_Mv0Q_s9dtjeLckHsjpLQoQ,7836
|
| 179 |
+
cryptography/x509/name.py,sha256=ty0_xf0LnHwZAdEf-d8FLO1K4hGqx_7DsD3CHwoLJiY,15101
|
| 180 |
+
cryptography/x509/ocsp.py,sha256=Yey6NdFV1MPjop24Mj_VenjEpg3kUaMopSWOK0AbeBs,12699
|
| 181 |
+
cryptography/x509/oid.py,sha256=BUzgXXGVWilkBkdKPTm9R4qElE9gAGHgdYPMZAp7PJo,931
|
| 182 |
+
cryptography/x509/verification.py,sha256=gR2C2c-XZQtblZhT5T5vjSKOtCb74ef2alPVmEcwFlM,958
|
miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/REQUESTED
ADDED
|
File without changes
|
miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: maturin (1.11.5)
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp313-abi3-linux_x86_64
|
miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/direct_url.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"dir_info": {}, "url": "file:///home/task_177247526678653/croot/cryptography-split_1772475308901/work"}
|
miniconda3/lib/python3.13/site-packages/cryptography-46.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.
|
miniconda3/lib/python3.13/site-packages/cryptography-46.0.5.dist-info/licenses/LICENSE.APACHE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
https://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
https://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
miniconda3/lib/python3.13/site-packages/cryptography-46.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.
|
miniconda3/lib/python3.13/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__ = "46.0.5"
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
__author__ = "The Python Cryptographic Authority and individual contributors"
|
| 17 |
+
__copyright__ = f"Copyright 2013-2025 {__author__}"
|
miniconda3/lib/python3.13/site-packages/cryptography/__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 cryptography.__about__ import __author__, __copyright__, __version__
|
| 8 |
+
|
| 9 |
+
__all__ = [
|
| 10 |
+
"__author__",
|
| 11 |
+
"__copyright__",
|
| 12 |
+
"__version__",
|
| 13 |
+
]
|
miniconda3/lib/python3.13/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
|
miniconda3/lib/python3.13/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
|
miniconda3/lib/python3.13/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 |
+
"""
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/_oid.py
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
SHA3_224_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.7")
|
| 170 |
+
SHA3_256_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.8")
|
| 171 |
+
SHA3_384_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.9")
|
| 172 |
+
SHA3_512_NIST = ObjectIdentifier("2.16.840.1.101.3.4.2.10")
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
class PublicKeyAlgorithmOID:
|
| 176 |
+
DSA = ObjectIdentifier("1.2.840.10040.4.1")
|
| 177 |
+
EC_PUBLIC_KEY = ObjectIdentifier("1.2.840.10045.2.1")
|
| 178 |
+
RSAES_PKCS1_v1_5 = ObjectIdentifier("1.2.840.113549.1.1.1")
|
| 179 |
+
RSASSA_PSS = ObjectIdentifier("1.2.840.113549.1.1.10")
|
| 180 |
+
X25519 = ObjectIdentifier("1.3.101.110")
|
| 181 |
+
X448 = ObjectIdentifier("1.3.101.111")
|
| 182 |
+
ED25519 = ObjectIdentifier("1.3.101.112")
|
| 183 |
+
ED448 = ObjectIdentifier("1.3.101.113")
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
class ExtendedKeyUsageOID:
|
| 187 |
+
SERVER_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.1")
|
| 188 |
+
CLIENT_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.2")
|
| 189 |
+
CODE_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.3")
|
| 190 |
+
EMAIL_PROTECTION = ObjectIdentifier("1.3.6.1.5.5.7.3.4")
|
| 191 |
+
TIME_STAMPING = ObjectIdentifier("1.3.6.1.5.5.7.3.8")
|
| 192 |
+
OCSP_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.9")
|
| 193 |
+
ANY_EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37.0")
|
| 194 |
+
SMARTCARD_LOGON = ObjectIdentifier("1.3.6.1.4.1.311.20.2.2")
|
| 195 |
+
KERBEROS_PKINIT_KDC = ObjectIdentifier("1.3.6.1.5.2.3.5")
|
| 196 |
+
IPSEC_IKE = ObjectIdentifier("1.3.6.1.5.5.7.3.17")
|
| 197 |
+
BUNDLE_SECURITY = ObjectIdentifier("1.3.6.1.5.5.7.3.35")
|
| 198 |
+
CERTIFICATE_TRANSPARENCY = ObjectIdentifier("1.3.6.1.4.1.11129.2.4.4")
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
class OtherNameFormOID:
|
| 202 |
+
PERMANENT_IDENTIFIER = ObjectIdentifier("1.3.6.1.5.5.7.8.3")
|
| 203 |
+
HW_MODULE_NAME = ObjectIdentifier("1.3.6.1.5.5.7.8.4")
|
| 204 |
+
DNS_SRV = ObjectIdentifier("1.3.6.1.5.5.7.8.7")
|
| 205 |
+
NAI_REALM = ObjectIdentifier("1.3.6.1.5.5.7.8.8")
|
| 206 |
+
SMTP_UTF8_MAILBOX = ObjectIdentifier("1.3.6.1.5.5.7.8.9")
|
| 207 |
+
ACP_NODE_NAME = ObjectIdentifier("1.3.6.1.5.5.7.8.10")
|
| 208 |
+
BUNDLE_EID = ObjectIdentifier("1.3.6.1.5.5.7.8.11")
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
class AuthorityInformationAccessOID:
|
| 212 |
+
CA_ISSUERS = ObjectIdentifier("1.3.6.1.5.5.7.48.2")
|
| 213 |
+
OCSP = ObjectIdentifier("1.3.6.1.5.5.7.48.1")
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
class SubjectInformationAccessOID:
|
| 217 |
+
CA_REPOSITORY = ObjectIdentifier("1.3.6.1.5.5.7.48.5")
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
class CertificatePoliciesOID:
|
| 221 |
+
CPS_QUALIFIER = ObjectIdentifier("1.3.6.1.5.5.7.2.1")
|
| 222 |
+
CPS_USER_NOTICE = ObjectIdentifier("1.3.6.1.5.5.7.2.2")
|
| 223 |
+
ANY_POLICY = ObjectIdentifier("2.5.29.32.0")
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
class AttributeOID:
|
| 227 |
+
CHALLENGE_PASSWORD = ObjectIdentifier("1.2.840.113549.1.9.7")
|
| 228 |
+
UNSTRUCTURED_NAME = ObjectIdentifier("1.2.840.113549.1.9.2")
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
_OID_NAMES = {
|
| 232 |
+
NameOID.COMMON_NAME: "commonName",
|
| 233 |
+
NameOID.COUNTRY_NAME: "countryName",
|
| 234 |
+
NameOID.LOCALITY_NAME: "localityName",
|
| 235 |
+
NameOID.STATE_OR_PROVINCE_NAME: "stateOrProvinceName",
|
| 236 |
+
NameOID.STREET_ADDRESS: "streetAddress",
|
| 237 |
+
NameOID.ORGANIZATION_NAME: "organizationName",
|
| 238 |
+
NameOID.ORGANIZATIONAL_UNIT_NAME: "organizationalUnitName",
|
| 239 |
+
NameOID.SERIAL_NUMBER: "serialNumber",
|
| 240 |
+
NameOID.SURNAME: "surname",
|
| 241 |
+
NameOID.GIVEN_NAME: "givenName",
|
| 242 |
+
NameOID.TITLE: "title",
|
| 243 |
+
NameOID.GENERATION_QUALIFIER: "generationQualifier",
|
| 244 |
+
NameOID.X500_UNIQUE_IDENTIFIER: "x500UniqueIdentifier",
|
| 245 |
+
NameOID.DN_QUALIFIER: "dnQualifier",
|
| 246 |
+
NameOID.PSEUDONYM: "pseudonym",
|
| 247 |
+
NameOID.USER_ID: "userID",
|
| 248 |
+
NameOID.DOMAIN_COMPONENT: "domainComponent",
|
| 249 |
+
NameOID.EMAIL_ADDRESS: "emailAddress",
|
| 250 |
+
NameOID.JURISDICTION_COUNTRY_NAME: "jurisdictionCountryName",
|
| 251 |
+
NameOID.JURISDICTION_LOCALITY_NAME: "jurisdictionLocalityName",
|
| 252 |
+
NameOID.JURISDICTION_STATE_OR_PROVINCE_NAME: (
|
| 253 |
+
"jurisdictionStateOrProvinceName"
|
| 254 |
+
),
|
| 255 |
+
NameOID.BUSINESS_CATEGORY: "businessCategory",
|
| 256 |
+
NameOID.POSTAL_ADDRESS: "postalAddress",
|
| 257 |
+
NameOID.POSTAL_CODE: "postalCode",
|
| 258 |
+
NameOID.INN: "INN",
|
| 259 |
+
NameOID.OGRN: "OGRN",
|
| 260 |
+
NameOID.SNILS: "SNILS",
|
| 261 |
+
NameOID.UNSTRUCTURED_NAME: "unstructuredName",
|
| 262 |
+
SignatureAlgorithmOID.RSA_WITH_MD5: "md5WithRSAEncryption",
|
| 263 |
+
SignatureAlgorithmOID.RSA_WITH_SHA1: "sha1WithRSAEncryption",
|
| 264 |
+
SignatureAlgorithmOID.RSA_WITH_SHA224: "sha224WithRSAEncryption",
|
| 265 |
+
SignatureAlgorithmOID.RSA_WITH_SHA256: "sha256WithRSAEncryption",
|
| 266 |
+
SignatureAlgorithmOID.RSA_WITH_SHA384: "sha384WithRSAEncryption",
|
| 267 |
+
SignatureAlgorithmOID.RSA_WITH_SHA512: "sha512WithRSAEncryption",
|
| 268 |
+
SignatureAlgorithmOID.RSASSA_PSS: "rsassaPss",
|
| 269 |
+
SignatureAlgorithmOID.ECDSA_WITH_SHA1: "ecdsa-with-SHA1",
|
| 270 |
+
SignatureAlgorithmOID.ECDSA_WITH_SHA224: "ecdsa-with-SHA224",
|
| 271 |
+
SignatureAlgorithmOID.ECDSA_WITH_SHA256: "ecdsa-with-SHA256",
|
| 272 |
+
SignatureAlgorithmOID.ECDSA_WITH_SHA384: "ecdsa-with-SHA384",
|
| 273 |
+
SignatureAlgorithmOID.ECDSA_WITH_SHA512: "ecdsa-with-SHA512",
|
| 274 |
+
SignatureAlgorithmOID.DSA_WITH_SHA1: "dsa-with-sha1",
|
| 275 |
+
SignatureAlgorithmOID.DSA_WITH_SHA224: "dsa-with-sha224",
|
| 276 |
+
SignatureAlgorithmOID.DSA_WITH_SHA256: "dsa-with-sha256",
|
| 277 |
+
SignatureAlgorithmOID.ED25519: "ed25519",
|
| 278 |
+
SignatureAlgorithmOID.ED448: "ed448",
|
| 279 |
+
SignatureAlgorithmOID.GOSTR3411_94_WITH_3410_2001: (
|
| 280 |
+
"GOST R 34.11-94 with GOST R 34.10-2001"
|
| 281 |
+
),
|
| 282 |
+
SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_256: (
|
| 283 |
+
"GOST R 34.10-2012 with GOST R 34.11-2012 (256 bit)"
|
| 284 |
+
),
|
| 285 |
+
SignatureAlgorithmOID.GOSTR3410_2012_WITH_3411_2012_512: (
|
| 286 |
+
"GOST R 34.10-2012 with GOST R 34.11-2012 (512 bit)"
|
| 287 |
+
),
|
| 288 |
+
HashAlgorithmOID.SHA1: "sha1",
|
| 289 |
+
HashAlgorithmOID.SHA224: "sha224",
|
| 290 |
+
HashAlgorithmOID.SHA256: "sha256",
|
| 291 |
+
HashAlgorithmOID.SHA384: "sha384",
|
| 292 |
+
HashAlgorithmOID.SHA512: "sha512",
|
| 293 |
+
HashAlgorithmOID.SHA3_224: "sha3_224",
|
| 294 |
+
HashAlgorithmOID.SHA3_256: "sha3_256",
|
| 295 |
+
HashAlgorithmOID.SHA3_384: "sha3_384",
|
| 296 |
+
HashAlgorithmOID.SHA3_512: "sha3_512",
|
| 297 |
+
HashAlgorithmOID.SHA3_224_NIST: "sha3_224",
|
| 298 |
+
HashAlgorithmOID.SHA3_256_NIST: "sha3_256",
|
| 299 |
+
HashAlgorithmOID.SHA3_384_NIST: "sha3_384",
|
| 300 |
+
HashAlgorithmOID.SHA3_512_NIST: "sha3_512",
|
| 301 |
+
PublicKeyAlgorithmOID.DSA: "dsaEncryption",
|
| 302 |
+
PublicKeyAlgorithmOID.EC_PUBLIC_KEY: "id-ecPublicKey",
|
| 303 |
+
PublicKeyAlgorithmOID.RSAES_PKCS1_v1_5: "rsaEncryption",
|
| 304 |
+
PublicKeyAlgorithmOID.X25519: "X25519",
|
| 305 |
+
PublicKeyAlgorithmOID.X448: "X448",
|
| 306 |
+
ExtendedKeyUsageOID.SERVER_AUTH: "serverAuth",
|
| 307 |
+
ExtendedKeyUsageOID.CLIENT_AUTH: "clientAuth",
|
| 308 |
+
ExtendedKeyUsageOID.CODE_SIGNING: "codeSigning",
|
| 309 |
+
ExtendedKeyUsageOID.EMAIL_PROTECTION: "emailProtection",
|
| 310 |
+
ExtendedKeyUsageOID.TIME_STAMPING: "timeStamping",
|
| 311 |
+
ExtendedKeyUsageOID.OCSP_SIGNING: "OCSPSigning",
|
| 312 |
+
ExtendedKeyUsageOID.SMARTCARD_LOGON: "msSmartcardLogin",
|
| 313 |
+
ExtendedKeyUsageOID.KERBEROS_PKINIT_KDC: "pkInitKDC",
|
| 314 |
+
ExtensionOID.SUBJECT_DIRECTORY_ATTRIBUTES: "subjectDirectoryAttributes",
|
| 315 |
+
ExtensionOID.SUBJECT_KEY_IDENTIFIER: "subjectKeyIdentifier",
|
| 316 |
+
ExtensionOID.KEY_USAGE: "keyUsage",
|
| 317 |
+
ExtensionOID.PRIVATE_KEY_USAGE_PERIOD: "privateKeyUsagePeriod",
|
| 318 |
+
ExtensionOID.SUBJECT_ALTERNATIVE_NAME: "subjectAltName",
|
| 319 |
+
ExtensionOID.ISSUER_ALTERNATIVE_NAME: "issuerAltName",
|
| 320 |
+
ExtensionOID.BASIC_CONSTRAINTS: "basicConstraints",
|
| 321 |
+
ExtensionOID.PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS: (
|
| 322 |
+
"signedCertificateTimestampList"
|
| 323 |
+
),
|
| 324 |
+
ExtensionOID.SIGNED_CERTIFICATE_TIMESTAMPS: (
|
| 325 |
+
"signedCertificateTimestampList"
|
| 326 |
+
),
|
| 327 |
+
ExtensionOID.PRECERT_POISON: "ctPoison",
|
| 328 |
+
ExtensionOID.MS_CERTIFICATE_TEMPLATE: "msCertificateTemplate",
|
| 329 |
+
ExtensionOID.ADMISSIONS: "Admissions",
|
| 330 |
+
CRLEntryExtensionOID.CRL_REASON: "cRLReason",
|
| 331 |
+
CRLEntryExtensionOID.INVALIDITY_DATE: "invalidityDate",
|
| 332 |
+
CRLEntryExtensionOID.CERTIFICATE_ISSUER: "certificateIssuer",
|
| 333 |
+
ExtensionOID.NAME_CONSTRAINTS: "nameConstraints",
|
| 334 |
+
ExtensionOID.CRL_DISTRIBUTION_POINTS: "cRLDistributionPoints",
|
| 335 |
+
ExtensionOID.CERTIFICATE_POLICIES: "certificatePolicies",
|
| 336 |
+
ExtensionOID.POLICY_MAPPINGS: "policyMappings",
|
| 337 |
+
ExtensionOID.AUTHORITY_KEY_IDENTIFIER: "authorityKeyIdentifier",
|
| 338 |
+
ExtensionOID.POLICY_CONSTRAINTS: "policyConstraints",
|
| 339 |
+
ExtensionOID.EXTENDED_KEY_USAGE: "extendedKeyUsage",
|
| 340 |
+
ExtensionOID.FRESHEST_CRL: "freshestCRL",
|
| 341 |
+
ExtensionOID.INHIBIT_ANY_POLICY: "inhibitAnyPolicy",
|
| 342 |
+
ExtensionOID.ISSUING_DISTRIBUTION_POINT: "issuingDistributionPoint",
|
| 343 |
+
ExtensionOID.AUTHORITY_INFORMATION_ACCESS: "authorityInfoAccess",
|
| 344 |
+
ExtensionOID.SUBJECT_INFORMATION_ACCESS: "subjectInfoAccess",
|
| 345 |
+
ExtensionOID.OCSP_NO_CHECK: "OCSPNoCheck",
|
| 346 |
+
ExtensionOID.CRL_NUMBER: "cRLNumber",
|
| 347 |
+
ExtensionOID.DELTA_CRL_INDICATOR: "deltaCRLIndicator",
|
| 348 |
+
ExtensionOID.TLS_FEATURE: "TLSFeature",
|
| 349 |
+
AuthorityInformationAccessOID.OCSP: "OCSP",
|
| 350 |
+
AuthorityInformationAccessOID.CA_ISSUERS: "caIssuers",
|
| 351 |
+
SubjectInformationAccessOID.CA_REPOSITORY: "caRepository",
|
| 352 |
+
CertificatePoliciesOID.CPS_QUALIFIER: "id-qt-cps",
|
| 353 |
+
CertificatePoliciesOID.CPS_USER_NOTICE: "id-qt-unotice",
|
| 354 |
+
OCSPExtensionOID.NONCE: "OCSPNonce",
|
| 355 |
+
AttributeOID.CHALLENGE_PASSWORD: "challengePassword",
|
| 356 |
+
}
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/asn1/__init__.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 cryptography.hazmat.asn1.asn1 import encode_der, sequence
|
| 6 |
+
|
| 7 |
+
__all__ = [
|
| 8 |
+
"encode_der",
|
| 9 |
+
"sequence",
|
| 10 |
+
]
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/asn1/asn1.py
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 dataclasses
|
| 8 |
+
import sys
|
| 9 |
+
import typing
|
| 10 |
+
|
| 11 |
+
if sys.version_info < (3, 11):
|
| 12 |
+
import typing_extensions
|
| 13 |
+
|
| 14 |
+
# We use the `include_extras` parameter of `get_type_hints`, which was
|
| 15 |
+
# added in Python 3.9. This can be replaced by the `typing` version
|
| 16 |
+
# once the min version is >= 3.9
|
| 17 |
+
if sys.version_info < (3, 9):
|
| 18 |
+
get_type_hints = typing_extensions.get_type_hints
|
| 19 |
+
else:
|
| 20 |
+
get_type_hints = typing.get_type_hints
|
| 21 |
+
else:
|
| 22 |
+
get_type_hints = typing.get_type_hints
|
| 23 |
+
|
| 24 |
+
from cryptography.hazmat.bindings._rust import declarative_asn1
|
| 25 |
+
|
| 26 |
+
T = typing.TypeVar("T", covariant=True)
|
| 27 |
+
U = typing.TypeVar("U")
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
encode_der = declarative_asn1.encode_der
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def _normalize_field_type(
|
| 34 |
+
field_type: typing.Any, field_name: str
|
| 35 |
+
) -> declarative_asn1.AnnotatedType:
|
| 36 |
+
annotation = declarative_asn1.Annotation()
|
| 37 |
+
|
| 38 |
+
if hasattr(field_type, "__asn1_root__"):
|
| 39 |
+
annotated_root = field_type.__asn1_root__
|
| 40 |
+
if not isinstance(annotated_root, declarative_asn1.AnnotatedType):
|
| 41 |
+
raise TypeError(f"unsupported root type: {annotated_root}")
|
| 42 |
+
return annotated_root
|
| 43 |
+
else:
|
| 44 |
+
rust_field_type = declarative_asn1.non_root_python_to_rust(field_type)
|
| 45 |
+
|
| 46 |
+
return declarative_asn1.AnnotatedType(rust_field_type, annotation)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def _annotate_fields(
|
| 50 |
+
raw_fields: dict[str, type],
|
| 51 |
+
) -> dict[str, declarative_asn1.AnnotatedType]:
|
| 52 |
+
fields = {}
|
| 53 |
+
for field_name, field_type in raw_fields.items():
|
| 54 |
+
# Recursively normalize the field type into something that the
|
| 55 |
+
# Rust code can understand.
|
| 56 |
+
annotated_field_type = _normalize_field_type(field_type, field_name)
|
| 57 |
+
fields[field_name] = annotated_field_type
|
| 58 |
+
|
| 59 |
+
return fields
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def _register_asn1_sequence(cls: type[U]) -> None:
|
| 63 |
+
raw_fields = get_type_hints(cls, include_extras=True)
|
| 64 |
+
root = declarative_asn1.AnnotatedType(
|
| 65 |
+
declarative_asn1.Type.Sequence(cls, _annotate_fields(raw_fields)),
|
| 66 |
+
declarative_asn1.Annotation(),
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
setattr(cls, "__asn1_root__", root)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
# Due to https://github.com/python/mypy/issues/19731, we can't define an alias
|
| 73 |
+
# for `dataclass_transform` that conditionally points to `typing` or
|
| 74 |
+
# `typing_extensions` depending on the Python version (like we do for
|
| 75 |
+
# `get_type_hints`).
|
| 76 |
+
# We work around it by making the whole decorated class conditional on the
|
| 77 |
+
# Python version.
|
| 78 |
+
if sys.version_info < (3, 11):
|
| 79 |
+
|
| 80 |
+
@typing_extensions.dataclass_transform(kw_only_default=True)
|
| 81 |
+
def sequence(cls: type[U]) -> type[U]:
|
| 82 |
+
# We use `dataclasses.dataclass` to add an __init__ method
|
| 83 |
+
# to the class with keyword-only parameters.
|
| 84 |
+
if sys.version_info >= (3, 10):
|
| 85 |
+
dataclass_cls = dataclasses.dataclass(
|
| 86 |
+
repr=False,
|
| 87 |
+
eq=False,
|
| 88 |
+
# `match_args` was added in Python 3.10 and defaults
|
| 89 |
+
# to True
|
| 90 |
+
match_args=False,
|
| 91 |
+
# `kw_only` was added in Python 3.10 and defaults to
|
| 92 |
+
# False
|
| 93 |
+
kw_only=True,
|
| 94 |
+
)(cls)
|
| 95 |
+
else:
|
| 96 |
+
dataclass_cls = dataclasses.dataclass(
|
| 97 |
+
repr=False,
|
| 98 |
+
eq=False,
|
| 99 |
+
)(cls)
|
| 100 |
+
_register_asn1_sequence(dataclass_cls)
|
| 101 |
+
return dataclass_cls
|
| 102 |
+
|
| 103 |
+
else:
|
| 104 |
+
|
| 105 |
+
@typing.dataclass_transform(kw_only_default=True)
|
| 106 |
+
def sequence(cls: type[U]) -> type[U]:
|
| 107 |
+
# Only add an __init__ method, with keyword-only
|
| 108 |
+
# parameters.
|
| 109 |
+
dataclass_cls = dataclasses.dataclass(
|
| 110 |
+
repr=False,
|
| 111 |
+
eq=False,
|
| 112 |
+
match_args=False,
|
| 113 |
+
kw_only=True,
|
| 114 |
+
)(cls)
|
| 115 |
+
_register_asn1_sequence(dataclass_cls)
|
| 116 |
+
return dataclass_cls
|
miniconda3/lib/python3.13/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
|
miniconda3/lib/python3.13/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"]
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/backends/openssl/backend.py
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
return not self._fips_enabled
|
| 264 |
+
|
| 265 |
+
def x448_supported(self) -> bool:
|
| 266 |
+
if self._fips_enabled:
|
| 267 |
+
return False
|
| 268 |
+
return (
|
| 269 |
+
not rust_openssl.CRYPTOGRAPHY_IS_LIBRESSL
|
| 270 |
+
and not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
|
| 271 |
+
and not rust_openssl.CRYPTOGRAPHY_IS_AWSLC
|
| 272 |
+
)
|
| 273 |
+
|
| 274 |
+
def ed25519_supported(self) -> bool:
|
| 275 |
+
return not self._fips_enabled
|
| 276 |
+
|
| 277 |
+
def ed448_supported(self) -> bool:
|
| 278 |
+
if self._fips_enabled:
|
| 279 |
+
return False
|
| 280 |
+
return (
|
| 281 |
+
not rust_openssl.CRYPTOGRAPHY_IS_LIBRESSL
|
| 282 |
+
and not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
|
| 283 |
+
and not rust_openssl.CRYPTOGRAPHY_IS_AWSLC
|
| 284 |
+
)
|
| 285 |
+
|
| 286 |
+
def ecdsa_deterministic_supported(self) -> bool:
|
| 287 |
+
return (
|
| 288 |
+
rust_openssl.CRYPTOGRAPHY_OPENSSL_320_OR_GREATER
|
| 289 |
+
and not self._fips_enabled
|
| 290 |
+
)
|
| 291 |
+
|
| 292 |
+
def poly1305_supported(self) -> bool:
|
| 293 |
+
return not self._fips_enabled
|
| 294 |
+
|
| 295 |
+
def pkcs7_supported(self) -> bool:
|
| 296 |
+
return (
|
| 297 |
+
not rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
|
| 298 |
+
and not rust_openssl.CRYPTOGRAPHY_IS_AWSLC
|
| 299 |
+
)
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
backend = Backend()
|
miniconda3/lib/python3.13/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.
|
miniconda3/lib/python3.13/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")
|
miniconda3/lib/python3.13/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
|
miniconda3/lib/python3.13/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: ...
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/declarative_asn1.pyi
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
import typing
|
| 5 |
+
|
| 6 |
+
def encode_der(value: typing.Any) -> bytes: ...
|
| 7 |
+
def non_root_python_to_rust(cls: type) -> Type: ...
|
| 8 |
+
|
| 9 |
+
# Type is a Rust enum with tuple variants. For now, we express the type
|
| 10 |
+
# annotations like this:
|
| 11 |
+
class Type:
|
| 12 |
+
Sequence: typing.ClassVar[type]
|
| 13 |
+
PyInt: typing.ClassVar[type]
|
| 14 |
+
|
| 15 |
+
class Annotation:
|
| 16 |
+
def __new__(
|
| 17 |
+
cls,
|
| 18 |
+
) -> Annotation: ...
|
| 19 |
+
|
| 20 |
+
class AnnotatedType:
|
| 21 |
+
inner: Type
|
| 22 |
+
annotation: Annotation
|
| 23 |
+
|
| 24 |
+
def __new__(cls, inner: Type, annotation: Annotation) -> AnnotatedType: ...
|
| 25 |
+
|
| 26 |
+
class AnnotatedTypeObject:
|
| 27 |
+
annotated_type: AnnotatedType
|
| 28 |
+
value: typing.Any
|
| 29 |
+
|
| 30 |
+
def __new__(
|
| 31 |
+
cls, annotated_type: AnnotatedType, value: typing.Any
|
| 32 |
+
) -> AnnotatedTypeObject: ...
|
miniconda3/lib/python3.13/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
|
miniconda3/lib/python3.13/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: ...
|
miniconda3/lib/python3.13/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: ...
|
miniconda3/lib/python3.13/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: ...
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 ciphers
|
| 8 |
+
from cryptography.hazmat.primitives.ciphers import modes
|
| 9 |
+
|
| 10 |
+
@typing.overload
|
| 11 |
+
def create_encryption_ctx(
|
| 12 |
+
algorithm: ciphers.CipherAlgorithm, mode: modes.ModeWithAuthenticationTag
|
| 13 |
+
) -> ciphers.AEADEncryptionContext: ...
|
| 14 |
+
@typing.overload
|
| 15 |
+
def create_encryption_ctx(
|
| 16 |
+
algorithm: ciphers.CipherAlgorithm, mode: modes.Mode | None
|
| 17 |
+
) -> ciphers.CipherContext: ...
|
| 18 |
+
@typing.overload
|
| 19 |
+
def create_decryption_ctx(
|
| 20 |
+
algorithm: ciphers.CipherAlgorithm, mode: modes.ModeWithAuthenticationTag
|
| 21 |
+
) -> ciphers.AEADDecryptionContext: ...
|
| 22 |
+
@typing.overload
|
| 23 |
+
def create_decryption_ctx(
|
| 24 |
+
algorithm: ciphers.CipherAlgorithm, mode: modes.Mode | None
|
| 25 |
+
) -> ciphers.CipherContext: ...
|
| 26 |
+
def cipher_supported(
|
| 27 |
+
algorithm: ciphers.CipherAlgorithm, mode: modes.Mode
|
| 28 |
+
) -> bool: ...
|
| 29 |
+
def _advance(
|
| 30 |
+
ctx: ciphers.AEADEncryptionContext | ciphers.AEADDecryptionContext, n: int
|
| 31 |
+
) -> None: ...
|
| 32 |
+
def _advance_aad(
|
| 33 |
+
ctx: ciphers.AEADEncryptionContext | ciphers.AEADDecryptionContext, n: int
|
| 34 |
+
) -> None: ...
|
| 35 |
+
|
| 36 |
+
class CipherContext: ...
|
| 37 |
+
class AEADEncryptionContext: ...
|
| 38 |
+
class AEADDecryptionContext: ...
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 ciphers
|
| 8 |
+
|
| 9 |
+
class CMAC:
|
| 10 |
+
def __init__(
|
| 11 |
+
self,
|
| 12 |
+
algorithm: ciphers.BlockCipherAlgorithm,
|
| 13 |
+
backend: typing.Any = None,
|
| 14 |
+
) -> None: ...
|
| 15 |
+
def update(self, data: bytes) -> None: ...
|
| 16 |
+
def finalize(self) -> bytes: ...
|
| 17 |
+
def verify(self, signature: bytes) -> None: ...
|
| 18 |
+
def copy(self) -> CMAC: ...
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.asymmetric import dh
|
| 8 |
+
|
| 9 |
+
MIN_MODULUS_SIZE: int
|
| 10 |
+
|
| 11 |
+
class DHPrivateKey: ...
|
| 12 |
+
class DHPublicKey: ...
|
| 13 |
+
class DHParameters: ...
|
| 14 |
+
|
| 15 |
+
class DHPrivateNumbers:
|
| 16 |
+
def __init__(self, x: int, public_numbers: DHPublicNumbers) -> None: ...
|
| 17 |
+
def private_key(self, backend: typing.Any = None) -> dh.DHPrivateKey: ...
|
| 18 |
+
@property
|
| 19 |
+
def x(self) -> int: ...
|
| 20 |
+
@property
|
| 21 |
+
def public_numbers(self) -> DHPublicNumbers: ...
|
| 22 |
+
|
| 23 |
+
class DHPublicNumbers:
|
| 24 |
+
def __init__(
|
| 25 |
+
self, y: int, parameter_numbers: DHParameterNumbers
|
| 26 |
+
) -> None: ...
|
| 27 |
+
def public_key(self, backend: typing.Any = None) -> dh.DHPublicKey: ...
|
| 28 |
+
@property
|
| 29 |
+
def y(self) -> int: ...
|
| 30 |
+
@property
|
| 31 |
+
def parameter_numbers(self) -> DHParameterNumbers: ...
|
| 32 |
+
|
| 33 |
+
class DHParameterNumbers:
|
| 34 |
+
def __init__(self, p: int, g: int, q: int | None = None) -> None: ...
|
| 35 |
+
def parameters(self, backend: typing.Any = None) -> dh.DHParameters: ...
|
| 36 |
+
@property
|
| 37 |
+
def p(self) -> int: ...
|
| 38 |
+
@property
|
| 39 |
+
def g(self) -> int: ...
|
| 40 |
+
@property
|
| 41 |
+
def q(self) -> int | None: ...
|
| 42 |
+
|
| 43 |
+
def generate_parameters(
|
| 44 |
+
generator: int, key_size: int, backend: typing.Any = None
|
| 45 |
+
) -> dh.DHParameters: ...
|
| 46 |
+
def from_pem_parameters(
|
| 47 |
+
data: bytes, backend: typing.Any = None
|
| 48 |
+
) -> dh.DHParameters: ...
|
| 49 |
+
def from_der_parameters(
|
| 50 |
+
data: bytes, backend: typing.Any = None
|
| 51 |
+
) -> dh.DHParameters: ...
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.asymmetric import dsa
|
| 8 |
+
|
| 9 |
+
class DSAPrivateKey: ...
|
| 10 |
+
class DSAPublicKey: ...
|
| 11 |
+
class DSAParameters: ...
|
| 12 |
+
|
| 13 |
+
class DSAPrivateNumbers:
|
| 14 |
+
def __init__(self, x: int, public_numbers: DSAPublicNumbers) -> None: ...
|
| 15 |
+
@property
|
| 16 |
+
def x(self) -> int: ...
|
| 17 |
+
@property
|
| 18 |
+
def public_numbers(self) -> DSAPublicNumbers: ...
|
| 19 |
+
def private_key(self, backend: typing.Any = None) -> dsa.DSAPrivateKey: ...
|
| 20 |
+
|
| 21 |
+
class DSAPublicNumbers:
|
| 22 |
+
def __init__(
|
| 23 |
+
self, y: int, parameter_numbers: DSAParameterNumbers
|
| 24 |
+
) -> None: ...
|
| 25 |
+
@property
|
| 26 |
+
def y(self) -> int: ...
|
| 27 |
+
@property
|
| 28 |
+
def parameter_numbers(self) -> DSAParameterNumbers: ...
|
| 29 |
+
def public_key(self, backend: typing.Any = None) -> dsa.DSAPublicKey: ...
|
| 30 |
+
|
| 31 |
+
class DSAParameterNumbers:
|
| 32 |
+
def __init__(self, p: int, q: int, g: int) -> None: ...
|
| 33 |
+
@property
|
| 34 |
+
def p(self) -> int: ...
|
| 35 |
+
@property
|
| 36 |
+
def q(self) -> int: ...
|
| 37 |
+
@property
|
| 38 |
+
def g(self) -> int: ...
|
| 39 |
+
def parameters(self, backend: typing.Any = None) -> dsa.DSAParameters: ...
|
| 40 |
+
|
| 41 |
+
def generate_parameters(key_size: int) -> dsa.DSAParameters: ...
|
miniconda3/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi
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 |
+
import typing
|
| 6 |
+
|
| 7 |
+
from cryptography.hazmat.primitives.asymmetric import ec
|
| 8 |
+
|
| 9 |
+
class ECPrivateKey: ...
|
| 10 |
+
class ECPublicKey: ...
|
| 11 |
+
|
| 12 |
+
class EllipticCurvePrivateNumbers:
|
| 13 |
+
def __init__(
|
| 14 |
+
self, private_value: int, public_numbers: EllipticCurvePublicNumbers
|
| 15 |
+
) -> None: ...
|
| 16 |
+
def private_key(
|
| 17 |
+
self, backend: typing.Any = None
|
| 18 |
+
) -> ec.EllipticCurvePrivateKey: ...
|
| 19 |
+
@property
|
| 20 |
+
def private_value(self) -> int: ...
|
| 21 |
+
@property
|
| 22 |
+
def public_numbers(self) -> EllipticCurvePublicNumbers: ...
|
| 23 |
+
|
| 24 |
+
class EllipticCurvePublicNumbers:
|
| 25 |
+
def __init__(self, x: int, y: int, curve: ec.EllipticCurve) -> None: ...
|
| 26 |
+
def public_key(
|
| 27 |
+
self, backend: typing.Any = None
|
| 28 |
+
) -> ec.EllipticCurvePublicKey: ...
|
| 29 |
+
@property
|
| 30 |
+
def x(self) -> int: ...
|
| 31 |
+
@property
|
| 32 |
+
def y(self) -> int: ...
|
| 33 |
+
@property
|
| 34 |
+
def curve(self) -> ec.EllipticCurve: ...
|
| 35 |
+
def __eq__(self, other: object) -> bool: ...
|
| 36 |
+
|
| 37 |
+
def curve_supported(curve: ec.EllipticCurve) -> bool: ...
|
| 38 |
+
def generate_private_key(
|
| 39 |
+
curve: ec.EllipticCurve, backend: typing.Any = None
|
| 40 |
+
) -> ec.EllipticCurvePrivateKey: ...
|
| 41 |
+
def from_private_numbers(
|
| 42 |
+
numbers: ec.EllipticCurvePrivateNumbers,
|
| 43 |
+
) -> ec.EllipticCurvePrivateKey: ...
|
| 44 |
+
def from_public_numbers(
|
| 45 |
+
numbers: ec.EllipticCurvePublicNumbers,
|
| 46 |
+
) -> ec.EllipticCurvePublicKey: ...
|
| 47 |
+
def from_public_bytes(
|
| 48 |
+
curve: ec.EllipticCurve, data: bytes
|
| 49 |
+
) -> ec.EllipticCurvePublicKey: ...
|
| 50 |
+
def derive_private_key(
|
| 51 |
+
private_value: int, curve: ec.EllipticCurve
|
| 52 |
+
) -> ec.EllipticCurvePrivateKey: ...
|