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 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