python-pkcs11 0.9.4__tar.gz → 0.10.0__tar.gz
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.
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/actions/install-softhsm/action.yml +13 -1
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/workflows/coverage.yml +2 -2
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/workflows/tests.yml +2 -4
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/PKG-INFO +13 -9
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/README.rst +11 -6
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/conf.py +0 -1
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/extern/load_module.c +2 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/extern/load_module.h +2 -1
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/extern/pkcs11.h +27 -12
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/extern/pkcs11f.h +141 -10
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/extern/pkcs11t.h +503 -270
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/__init__.py +0 -2
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/_pkcs11.pxd +165 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/_pkcs11.pyi +2 -5
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/_pkcs11.pyx +195 -69
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/attributes.py +11 -3
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/constants.py +17 -2
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/defaults.py +11 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/mechanisms.py +37 -4
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/types.py +92 -13
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/util/rsa.py +6 -2
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pyproject.toml +2 -2
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/python_pkcs11.egg-info/PKG-INFO +13 -9
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/python_pkcs11.egg-info/SOURCES.txt +4 -0
- python_pkcs11-0.10.0/python_pkcs11.egg-info/scm_file_list.json +70 -0
- python_pkcs11-0.10.0/python_pkcs11.egg-info/scm_version.json +8 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/__init__.py +1 -1
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_aes.py +8 -17
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_attributes.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_dsa.py +1 -1
- python_pkcs11-0.10.0/tests/test_ml_dsa.py +62 -0
- python_pkcs11-0.10.0/tests/test_ml_kem.py +82 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_rsa.py +2 -2
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_sessions.py +2 -3
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_slots_and_tokens.py +1 -1
- python_pkcs11-0.10.0/uv.lock +1278 -0
- python_pkcs11-0.9.4/uv.lock +0 -1072
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/actions/install-opencryptoki/action.yml +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/actions/test-setup/action.yml +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/release-template.md +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/workflows/quality.yml +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.github/workflows/release.yml +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.gitignore +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.python-version +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/.readthedocs.yaml +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/LICENSE +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/MANIFEST.in +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/Makefile +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/api.rst +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/applied.rst +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/concurrency.rst +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/index.rst +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/make.bat +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/docs/opensc.rst +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/extern/.gitignore +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/extern/cryptoki.h +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/exceptions.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/py.typed +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/util/__init__.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/util/dh.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/util/dsa.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/util/ec.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/pkcs11/util/x509.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/python_pkcs11.egg-info/dependency_links.txt +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/python_pkcs11.egg-info/requires.txt +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/python_pkcs11.egg-info/top_level.txt +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/setup.cfg +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_des.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_dh.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_digest.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_ecc.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_iterators.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_multilib.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_public_key_external.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_threading.py +0 -0
- {python_pkcs11-0.9.4 → python_pkcs11-0.10.0}/tests/test_x509.py +0 -0
|
@@ -26,7 +26,19 @@ runs:
|
|
|
26
26
|
shell: bash
|
|
27
27
|
run: |
|
|
28
28
|
if [[ "${OS_NAME:0:6}" == 'ubuntu' ]]; then
|
|
29
|
-
|
|
29
|
+
openssl version
|
|
30
|
+
# Build SoftHSM2 devel from source so that ML-DSA autodetects via
|
|
31
|
+
# the OpenSSL 3.5+ already present on ubuntu-26.04
|
|
32
|
+
# TODO pin this to an actual ref once there's a release with ML-DSA support
|
|
33
|
+
sudo apt-get install -y libssl-dev
|
|
34
|
+
git clone --depth 1 https://github.com/softhsm/SoftHSMv2
|
|
35
|
+
cd SoftHSMv2
|
|
36
|
+
./autogen.sh
|
|
37
|
+
./configure --prefix=/usr --disable-gost --enable-mldsa
|
|
38
|
+
make -j"$(nproc)"
|
|
39
|
+
sudo make install
|
|
40
|
+
sudo ldconfig
|
|
41
|
+
cd ..
|
|
30
42
|
mkdir softhsm_tokens
|
|
31
43
|
echo "directories.tokendir = $(pwd)/softhsm_tokens" > /tmp/softhsm2.conf
|
|
32
44
|
echo "SOFTHSM2_CONF=/tmp/softhsm2.conf" >> "$GITHUB_ENV"
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
# At the time of writing, the latest version of Cython's line tracing
|
|
16
16
|
# seems to lead to segfaults in Python 3.13 -> TODO: investigate
|
|
17
17
|
pytest-coverage:
|
|
18
|
-
runs-on: ubuntu-
|
|
18
|
+
runs-on: ubuntu-26.04
|
|
19
19
|
strategy:
|
|
20
20
|
matrix:
|
|
21
21
|
pkcs11-platform:
|
|
@@ -53,7 +53,7 @@ jobs:
|
|
|
53
53
|
name: coverage-${{ strategy.job-index }}
|
|
54
54
|
path: "*-coverage.xml"
|
|
55
55
|
pytest-coverage-multilib:
|
|
56
|
-
runs-on: ubuntu-
|
|
56
|
+
runs-on: ubuntu-26.04
|
|
57
57
|
steps:
|
|
58
58
|
- name: Acquire sources
|
|
59
59
|
uses: actions/checkout@v6
|
|
@@ -18,11 +18,10 @@ jobs:
|
|
|
18
18
|
fail-fast: false
|
|
19
19
|
matrix:
|
|
20
20
|
os:
|
|
21
|
-
- ubuntu-
|
|
21
|
+
- ubuntu-26.04
|
|
22
22
|
- windows-latest
|
|
23
23
|
- macos-14
|
|
24
24
|
python-version:
|
|
25
|
-
- "3.9"
|
|
26
25
|
- "3.10"
|
|
27
26
|
- "3.11"
|
|
28
27
|
- "3.12"
|
|
@@ -56,12 +55,11 @@ jobs:
|
|
|
56
55
|
env:
|
|
57
56
|
PKCS11_MODULE: ${{ steps.setup.outputs.module }}
|
|
58
57
|
multilib-tests:
|
|
59
|
-
runs-on: ubuntu-
|
|
58
|
+
runs-on: ubuntu-26.04
|
|
60
59
|
strategy:
|
|
61
60
|
fail-fast: false
|
|
62
61
|
matrix:
|
|
63
62
|
python-version:
|
|
64
|
-
- "3.9"
|
|
65
63
|
- "3.10"
|
|
66
64
|
- "3.11"
|
|
67
65
|
- "3.12"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-pkcs11
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
4
|
Summary: PKCS#11 support for Python
|
|
5
5
|
Author-email: Andrey Kislyuk <kislyuk@gmail.com>, Danielle Madeley <danielle@madeley.id.au>
|
|
6
6
|
Maintainer-email: Andrey Kislyuk <kislyuk@gmail.com>
|
|
@@ -11,14 +11,13 @@ Project-URL: Issues, https://github.com/pyauth/python-pkcs11/issues
|
|
|
11
11
|
Project-URL: Repository, https://github.com/pyauth/python-pkcs11
|
|
12
12
|
Classifier: Programming Language :: Python
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
19
|
Classifier: Topic :: Security :: Cryptography
|
|
21
|
-
Requires-Python: >=3.
|
|
20
|
+
Requires-Python: >=3.10
|
|
22
21
|
Description-Content-Type: text/x-rst
|
|
23
22
|
License-File: LICENSE
|
|
24
23
|
Requires-Dist: asn1crypto>=1.5.1
|
|
@@ -320,11 +319,15 @@ Tested Compatibility
|
|
|
320
319
|
| +---------------------+--------------+-----------------+ | |
|
|
321
320
|
| | Derive Key | Works | Caveats [7]_ | | |
|
|
322
321
|
+--------+---------------------+--------------+-----------------+--------------+-------------------+
|
|
323
|
-
| EC | Generate key pair | Caveats [6]_ | ? [3]_ |
|
|
324
|
-
|
|
|
325
|
-
| | Sign/Verify (ECDSA) | Works [4]_ | ? [3]_ |
|
|
326
|
-
|
|
|
327
|
-
| | Derive key (ECDH) | Works | ? [3]_ |
|
|
322
|
+
| EC | Generate key pair | Caveats [6]_ | ? [3]_ | Works | Works |
|
|
323
|
+
| +---------------------+--------------+-----------------+--------------+-------------------+
|
|
324
|
+
| | Sign/Verify (ECDSA) | Works [4]_ | ? [3]_ | Works | Sign only [9]_ |
|
|
325
|
+
| +---------------------+--------------+-----------------+--------------+-------------------+
|
|
326
|
+
| | Derive key (ECDH) | Works | ? [3]_ | Works | ? |
|
|
327
|
+
+--------+---------------------+--------------+-----------------+--------------+-------------------+
|
|
328
|
+
| ML-DSA | Generate key pair | Works | ? [3]_ | Works | N/A |
|
|
329
|
+
| +---------------------+--------------+-----------------+--------------+ |
|
|
330
|
+
| | Sign/Verify | Works | ? [3]_ | Works | |
|
|
328
331
|
+--------+---------------------+--------------+-----------------+--------------+-------------------+
|
|
329
332
|
| Proprietary extensions | N/A | Not implemented | N/A | N/A |
|
|
330
333
|
+------------------------------+--------------+-----------------+--------------+-------------------+
|
|
@@ -341,7 +344,7 @@ Tested Compatibility
|
|
|
341
344
|
|
|
342
345
|
Python version:
|
|
343
346
|
|
|
344
|
-
* >= 3.
|
|
347
|
+
* >= 3.10
|
|
345
348
|
|
|
346
349
|
PKCS#11 versions:
|
|
347
350
|
|
|
@@ -349,6 +352,7 @@ PKCS#11 versions:
|
|
|
349
352
|
* 2.20
|
|
350
353
|
* 2.40
|
|
351
354
|
* 3.1
|
|
355
|
+
* 3.2
|
|
352
356
|
|
|
353
357
|
Feel free to send pull requests for any functionality that's not exposed. The
|
|
354
358
|
code is designed to be readable and expose the PKCS #11 spec in a
|
|
@@ -294,11 +294,15 @@ Tested Compatibility
|
|
|
294
294
|
| +---------------------+--------------+-----------------+ | |
|
|
295
295
|
| | Derive Key | Works | Caveats [7]_ | | |
|
|
296
296
|
+--------+---------------------+--------------+-----------------+--------------+-------------------+
|
|
297
|
-
| EC | Generate key pair | Caveats [6]_ | ? [3]_ |
|
|
298
|
-
|
|
|
299
|
-
| | Sign/Verify (ECDSA) | Works [4]_ | ? [3]_ |
|
|
300
|
-
|
|
|
301
|
-
| | Derive key (ECDH) | Works | ? [3]_ |
|
|
297
|
+
| EC | Generate key pair | Caveats [6]_ | ? [3]_ | Works | Works |
|
|
298
|
+
| +---------------------+--------------+-----------------+--------------+-------------------+
|
|
299
|
+
| | Sign/Verify (ECDSA) | Works [4]_ | ? [3]_ | Works | Sign only [9]_ |
|
|
300
|
+
| +---------------------+--------------+-----------------+--------------+-------------------+
|
|
301
|
+
| | Derive key (ECDH) | Works | ? [3]_ | Works | ? |
|
|
302
|
+
+--------+---------------------+--------------+-----------------+--------------+-------------------+
|
|
303
|
+
| ML-DSA | Generate key pair | Works | ? [3]_ | Works | N/A |
|
|
304
|
+
| +---------------------+--------------+-----------------+--------------+ |
|
|
305
|
+
| | Sign/Verify | Works | ? [3]_ | Works | |
|
|
302
306
|
+--------+---------------------+--------------+-----------------+--------------+-------------------+
|
|
303
307
|
| Proprietary extensions | N/A | Not implemented | N/A | N/A |
|
|
304
308
|
+------------------------------+--------------+-----------------+--------------+-------------------+
|
|
@@ -315,7 +319,7 @@ Tested Compatibility
|
|
|
315
319
|
|
|
316
320
|
Python version:
|
|
317
321
|
|
|
318
|
-
* >= 3.
|
|
322
|
+
* >= 3.10
|
|
319
323
|
|
|
320
324
|
PKCS#11 versions:
|
|
321
325
|
|
|
@@ -323,6 +327,7 @@ PKCS#11 versions:
|
|
|
323
327
|
* 2.20
|
|
324
328
|
* 2.40
|
|
325
329
|
* 3.1
|
|
330
|
+
* 3.2
|
|
326
331
|
|
|
327
332
|
Feel free to send pull requests for any functionality that's not exposed. The
|
|
328
333
|
code is designed to be readable and expose the PKCS #11 spec in a
|
|
@@ -38,6 +38,7 @@ static P11_HANDLE* p11_open(PyObject *path_str) {
|
|
|
38
38
|
result = (P11_HANDLE*) PyMem_Malloc(sizeof(P11_HANDLE));
|
|
39
39
|
result->lib_handle = handle;
|
|
40
40
|
result->get_function_list_ptr = ptr;
|
|
41
|
+
result->get_interface_ptr = GetProcAddress(handle, "C_GetInterface");
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
return result;
|
|
@@ -85,6 +86,7 @@ static P11_HANDLE* p11_open(PyObject *path_str) {
|
|
|
85
86
|
result = (P11_HANDLE*) PyMem_Malloc(sizeof(P11_HANDLE));
|
|
86
87
|
result->lib_handle = handle;
|
|
87
88
|
result->get_function_list_ptr = ptr;
|
|
89
|
+
result->get_interface_ptr = dlsym(handle, "C_GetInterface");
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
return result;
|
|
@@ -12,7 +12,8 @@ typedef void *LIB_HANDLE;
|
|
|
12
12
|
#ifndef P11_HANDLE
|
|
13
13
|
typedef struct P11_HANDLE {
|
|
14
14
|
LIB_HANDLE lib_handle;
|
|
15
|
-
void *
|
|
15
|
+
void *get_function_list_ptr;
|
|
16
|
+
void *get_interface_ptr; /* C_GetInterface direct export; NULL for v2.0 libs */
|
|
16
17
|
} P11_HANDLE;
|
|
17
18
|
#endif
|
|
18
19
|
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* PKCS #11 Specification Version 3.1
|
|
3
|
-
* OASIS Standard
|
|
4
|
-
* 23 July 2023
|
|
5
|
-
* Copyright (c) OASIS Open 2023. All Rights Reserved.
|
|
6
|
-
* Source: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/os/include/pkcs11-v3.1/
|
|
7
|
-
* Latest stage of narrative specification: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/pkcs11-spec-v3.1.html
|
|
8
|
-
* TC IPR Statement: https://www.oasis-open.org/committees/pkcs11/ipr.php
|
|
1
|
+
/* Copyright (c) OASIS Open 2016,2019,2024. All Rights Reserved./
|
|
9
2
|
* /Distributed under the terms of the OASIS IPR Policy,
|
|
10
|
-
* [
|
|
3
|
+
* [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
|
|
11
4
|
* IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
|
|
12
5
|
* PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others.
|
|
13
6
|
*/
|
|
14
7
|
|
|
8
|
+
/* Latest version of the specification:
|
|
9
|
+
* http://docs.oasis-open.org/pkcs11/pkcs11-base/v3.2/pkcs11-base-v3.2.html
|
|
10
|
+
*/
|
|
11
|
+
|
|
15
12
|
#ifndef _PKCS11_H_
|
|
16
13
|
#define _PKCS11_H_ 1
|
|
17
14
|
|
|
@@ -72,7 +69,7 @@ extern "C" {
|
|
|
72
69
|
* CK_VOID_PTR pReserved
|
|
73
70
|
* );
|
|
74
71
|
*
|
|
75
|
-
* If you're using Windows to declare a function in a Win32 Cryptoki .dll,
|
|
72
|
+
* If you're using Windows to declare a function in a Win32 Cryptoki .dll,
|
|
76
73
|
* it might be defined by:
|
|
77
74
|
*
|
|
78
75
|
* #define CK_DECLARE_FUNCTION(returnType, name) \
|
|
@@ -208,6 +205,21 @@ extern "C" {
|
|
|
208
205
|
#define CK_PKCS11_FUNCTION_INFO(name) \
|
|
209
206
|
__PASTE(CK_,name) name;
|
|
210
207
|
|
|
208
|
+
/* Create the 3.2 Function list */
|
|
209
|
+
struct CK_FUNCTION_LIST_3_2 {
|
|
210
|
+
|
|
211
|
+
CK_VERSION version; /* Cryptoki version */
|
|
212
|
+
|
|
213
|
+
/* Pile all the function pointers into the CK_FUNCTION_LIST. */
|
|
214
|
+
/* pkcs11f.h has all the information about the Cryptoki
|
|
215
|
+
* function prototypes.
|
|
216
|
+
*/
|
|
217
|
+
#include "pkcs11f.h"
|
|
218
|
+
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
#define CK_PKCS11_3_0_ONLY 1 /* don't include the 3.2 and later functions */
|
|
222
|
+
|
|
211
223
|
/* Create the 3.0 Function list */
|
|
212
224
|
struct CK_FUNCTION_LIST_3_0 {
|
|
213
225
|
|
|
@@ -221,7 +233,9 @@ struct CK_FUNCTION_LIST_3_0 {
|
|
|
221
233
|
|
|
222
234
|
};
|
|
223
235
|
|
|
224
|
-
#
|
|
236
|
+
#undef CK_PKCS11_3_0_ONLY
|
|
237
|
+
|
|
238
|
+
#define CK_PKCS11_2_0_ONLY 1 /* don't include the 3.0 and later functions */
|
|
225
239
|
|
|
226
240
|
/* Continue to define the old CK_FUNCTION_LIST */
|
|
227
241
|
struct CK_FUNCTION_LIST {
|
|
@@ -246,4 +260,5 @@ struct CK_FUNCTION_LIST {
|
|
|
246
260
|
}
|
|
247
261
|
#endif
|
|
248
262
|
|
|
249
|
-
#endif /* _PKCS11_H_ */
|
|
263
|
+
#endif /* _PKCS11_H_ */
|
|
264
|
+
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* PKCS #11 Specification Version 3.1
|
|
3
|
-
* OASIS Standard
|
|
4
|
-
* 23 July 2023
|
|
5
|
-
* Copyright (c) OASIS Open 2023. All Rights Reserved.
|
|
6
|
-
* Source: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/os/include/pkcs11-v3.1/
|
|
7
|
-
* Latest stage of narrative specification: https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/pkcs11-spec-v3.1.html
|
|
8
|
-
* TC IPR Statement: https://www.oasis-open.org/committees/pkcs11/ipr.php
|
|
1
|
+
/* Copyright (c) OASIS Open 2016, 2019, 2024. All Rights Reserved./
|
|
9
2
|
* /Distributed under the terms of the OASIS IPR Policy,
|
|
10
|
-
* [
|
|
3
|
+
* [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY
|
|
11
4
|
* IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A
|
|
12
5
|
* PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others.
|
|
13
6
|
*/
|
|
14
7
|
|
|
8
|
+
/* Latest version of the specification:
|
|
9
|
+
* http://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.2/pkcs11-spec-v3.2.html
|
|
10
|
+
*/
|
|
11
|
+
|
|
15
12
|
/* This header file contains pretty much everything about all the
|
|
16
13
|
* Cryptoki function prototypes. Because this information is
|
|
17
14
|
* used for more than just declaring function prototypes, the
|
|
@@ -1196,4 +1193,138 @@ CK_PKCS11_FUNCTION_INFO(C_MessageVerifyFinal)
|
|
|
1196
1193
|
);
|
|
1197
1194
|
#endif
|
|
1198
1195
|
|
|
1199
|
-
#
|
|
1196
|
+
#ifndef CK_PKCS11_3_0_ONLY
|
|
1197
|
+
CK_PKCS11_FUNCTION_INFO(C_EncapsulateKey)
|
|
1198
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1199
|
+
(
|
|
1200
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1201
|
+
CK_MECHANISM_PTR pMechanism, /* the encapsulation mechanism */
|
|
1202
|
+
CK_OBJECT_HANDLE hPublicKey, /* the encapsulating key */
|
|
1203
|
+
CK_ATTRIBUTE_PTR pTemplate, /* new key template */
|
|
1204
|
+
CK_ULONG ulAttributeCount, /* template length */
|
|
1205
|
+
CK_BYTE_PTR pCiphertext, /* the wrapped key */
|
|
1206
|
+
CK_ULONG_PTR pulCiphertextLen, /* the wrapped key size */
|
|
1207
|
+
CK_OBJECT_HANDLE_PTR phKey /* the encapsulated key */
|
|
1208
|
+
);
|
|
1209
|
+
#endif
|
|
1210
|
+
|
|
1211
|
+
CK_PKCS11_FUNCTION_INFO(C_DecapsulateKey)
|
|
1212
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1213
|
+
(
|
|
1214
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1215
|
+
CK_MECHANISM_PTR pMechanism, /* the decapsulation mechanism */
|
|
1216
|
+
CK_OBJECT_HANDLE hPrivateKey, /* the decapsulating key */
|
|
1217
|
+
CK_ATTRIBUTE_PTR pTemplate, /* new key template */
|
|
1218
|
+
CK_ULONG ulAttributeCount, /* template length */
|
|
1219
|
+
CK_BYTE_PTR pCiphertext, /* the wrapped key */
|
|
1220
|
+
CK_ULONG ulCiphertextLen, /* the wrapped key size */
|
|
1221
|
+
CK_OBJECT_HANDLE_PTR phKey /* the decapsulated key */
|
|
1222
|
+
);
|
|
1223
|
+
#endif
|
|
1224
|
+
|
|
1225
|
+
CK_PKCS11_FUNCTION_INFO(C_VerifySignatureInit)
|
|
1226
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1227
|
+
(
|
|
1228
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1229
|
+
CK_MECHANISM_PTR pMechanism, /* the verification mechanism */
|
|
1230
|
+
CK_OBJECT_HANDLE hKey, /* verification key */
|
|
1231
|
+
CK_BYTE_PTR pSignature, /* signature */
|
|
1232
|
+
CK_ULONG ulSignatureLen /* signature length */
|
|
1233
|
+
);
|
|
1234
|
+
#endif
|
|
1235
|
+
|
|
1236
|
+
CK_PKCS11_FUNCTION_INFO(C_VerifySignature)
|
|
1237
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1238
|
+
(
|
|
1239
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1240
|
+
CK_BYTE_PTR pData, /* signed data */
|
|
1241
|
+
CK_ULONG ulDataLen /* length of signed data */
|
|
1242
|
+
);
|
|
1243
|
+
#endif
|
|
1244
|
+
|
|
1245
|
+
CK_PKCS11_FUNCTION_INFO(C_VerifySignatureUpdate)
|
|
1246
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1247
|
+
(
|
|
1248
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1249
|
+
CK_BYTE_PTR pPart, /* signed data */
|
|
1250
|
+
CK_ULONG ulPartLen /* length of signed data */
|
|
1251
|
+
);
|
|
1252
|
+
#endif
|
|
1253
|
+
|
|
1254
|
+
CK_PKCS11_FUNCTION_INFO(C_VerifySignatureFinal)
|
|
1255
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1256
|
+
(
|
|
1257
|
+
CK_SESSION_HANDLE hSession /* the session's handle */
|
|
1258
|
+
);
|
|
1259
|
+
#endif
|
|
1260
|
+
|
|
1261
|
+
CK_PKCS11_FUNCTION_INFO(C_GetSessionValidationFlags)
|
|
1262
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1263
|
+
(
|
|
1264
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1265
|
+
CK_SESSION_VALIDATION_FLAGS_TYPE type, /* which state of flags */
|
|
1266
|
+
CK_FLAGS_PTR pFlags /* validation flags */
|
|
1267
|
+
);
|
|
1268
|
+
#endif
|
|
1269
|
+
|
|
1270
|
+
CK_PKCS11_FUNCTION_INFO(C_AsyncComplete)
|
|
1271
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1272
|
+
(
|
|
1273
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1274
|
+
CK_UTF8CHAR_PTR pFunctionName, /* pkcs11 function name */
|
|
1275
|
+
CK_ASYNC_DATA_PTR pResult /* operation result */
|
|
1276
|
+
);
|
|
1277
|
+
#endif
|
|
1278
|
+
|
|
1279
|
+
CK_PKCS11_FUNCTION_INFO(C_AsyncGetID)
|
|
1280
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1281
|
+
(
|
|
1282
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1283
|
+
CK_UTF8CHAR_PTR pFunctionName, /* pkcs11 function name */
|
|
1284
|
+
CK_ULONG_PTR pulID /* persistent operation id */
|
|
1285
|
+
);
|
|
1286
|
+
#endif
|
|
1287
|
+
|
|
1288
|
+
CK_PKCS11_FUNCTION_INFO(C_AsyncJoin)
|
|
1289
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1290
|
+
(
|
|
1291
|
+
CK_SESSION_HANDLE hSession, /* the session's handle */
|
|
1292
|
+
CK_UTF8CHAR_PTR pFunctionName, /* pkcs11 function name */
|
|
1293
|
+
CK_ULONG ulID, /* persistent operation id */
|
|
1294
|
+
CK_BYTE_PTR pData, /* location for the data */
|
|
1295
|
+
CK_ULONG ulData
|
|
1296
|
+
);
|
|
1297
|
+
#endif
|
|
1298
|
+
|
|
1299
|
+
CK_PKCS11_FUNCTION_INFO(C_WrapKeyAuthenticated)
|
|
1300
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1301
|
+
(
|
|
1302
|
+
CK_SESSION_HANDLE hSession,
|
|
1303
|
+
CK_MECHANISM_PTR pMechanism,
|
|
1304
|
+
CK_OBJECT_HANDLE hWrappingKey,
|
|
1305
|
+
CK_OBJECT_HANDLE hKey,
|
|
1306
|
+
CK_BYTE_PTR pAssociatedData,
|
|
1307
|
+
CK_ULONG ulAssociatedDataLen,
|
|
1308
|
+
CK_BYTE_PTR pWrappedKey,
|
|
1309
|
+
CK_ULONG_PTR pulWrappedKeyLen
|
|
1310
|
+
);
|
|
1311
|
+
#endif
|
|
1312
|
+
|
|
1313
|
+
CK_PKCS11_FUNCTION_INFO(C_UnwrapKeyAuthenticated)
|
|
1314
|
+
#ifdef CK_NEED_ARG_LIST
|
|
1315
|
+
(
|
|
1316
|
+
CK_SESSION_HANDLE hSession,
|
|
1317
|
+
CK_MECHANISM_PTR pMechanism,
|
|
1318
|
+
CK_OBJECT_HANDLE hUnwrappingKey,
|
|
1319
|
+
CK_BYTE_PTR pWrappedKey,
|
|
1320
|
+
CK_ULONG ulWrappedKeyLen,
|
|
1321
|
+
CK_ATTRIBUTE_PTR pTemplate,
|
|
1322
|
+
CK_ULONG ulAttributeCount,
|
|
1323
|
+
CK_BYTE_PTR pAssociatedData,
|
|
1324
|
+
CK_ULONG ulAssociatedDataLen,
|
|
1325
|
+
CK_OBJECT_HANDLE_PTR phKey
|
|
1326
|
+
);
|
|
1327
|
+
#endif
|
|
1328
|
+
|
|
1329
|
+
#endif /* CK_PKCS11_3_0_ONLY */
|
|
1330
|
+
#endif /* CK_PKCS11_2_0_ONLY */
|