python-pkcs11 0.9.2__cp314-cp314-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pkcs11/__init__.py +44 -0
- pkcs11/_pkcs11.cp314-win_amd64.pyd +0 -0
- pkcs11/_pkcs11.pxd +799 -0
- pkcs11/_pkcs11.pyx +2194 -0
- pkcs11/attributes.py +240 -0
- pkcs11/constants.py +541 -0
- pkcs11/defaults.py +106 -0
- pkcs11/exceptions.py +408 -0
- pkcs11/mechanisms.py +817 -0
- pkcs11/types.py +1217 -0
- pkcs11/util/__init__.py +12 -0
- pkcs11/util/dh.py +72 -0
- pkcs11/util/dsa.py +101 -0
- pkcs11/util/ec.py +133 -0
- pkcs11/util/rsa.py +81 -0
- pkcs11/util/x509.py +129 -0
- python_pkcs11-0.9.2.dist-info/METADATA +394 -0
- python_pkcs11-0.9.2.dist-info/RECORD +21 -0
- python_pkcs11-0.9.2.dist-info/WHEEL +5 -0
- python_pkcs11-0.9.2.dist-info/licenses/LICENSE +21 -0
- python_pkcs11-0.9.2.dist-info/top_level.txt +1 -0
pkcs11/__init__.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
:mod:`pkcs11` defines a high-level, "Pythonic" interface to PKCS#11.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from pkcs11.constants import * # noqa: F403
|
|
6
|
+
from pkcs11.exceptions import * # noqa: F403
|
|
7
|
+
from pkcs11.mechanisms import * # noqa: F403
|
|
8
|
+
from pkcs11.types import * # noqa: F403
|
|
9
|
+
from pkcs11.util import dh, dsa, ec, rsa, x509 # noqa: F401
|
|
10
|
+
|
|
11
|
+
_loaded = {}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def lib(so):
|
|
15
|
+
"""
|
|
16
|
+
Wrap the main library call coming from Cython with a preemptive
|
|
17
|
+
dynamic loading.
|
|
18
|
+
"""
|
|
19
|
+
global _loaded
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
_lib = _loaded[so]
|
|
23
|
+
if not _lib.initialized:
|
|
24
|
+
_lib.initialize()
|
|
25
|
+
return _lib
|
|
26
|
+
except KeyError:
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
from . import _pkcs11
|
|
30
|
+
|
|
31
|
+
_lib = _pkcs11.lib(so)
|
|
32
|
+
_loaded[so] = _lib
|
|
33
|
+
|
|
34
|
+
return _lib
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def unload(so):
|
|
38
|
+
global _loaded
|
|
39
|
+
try:
|
|
40
|
+
loaded_lib = _loaded[so]
|
|
41
|
+
except KeyError:
|
|
42
|
+
return
|
|
43
|
+
del _loaded[so]
|
|
44
|
+
loaded_lib.unload()
|
|
Binary file
|