summaryrefslogtreecommitdiff
path: root/tools/binman/btool
diff options
context:
space:
mode:
authorWojciech Dubowik <[email protected]>2026-02-20 10:15:16 +0100
committerSimon Glass <[email protected]>2026-03-18 06:14:17 -0600
commite73443167be055c646dfd7d5a79bc30ac33e31d5 (patch)
tree1ec17cb80fc58b6cab471efc3243f9ec687ffd2a /tools/binman/btool
parente2c46d33cfbb92f493b520524a099fdf9af0a056 (diff)
test: binman: Add test for pkcs11 signed capsule
Test pkcs11 URI support for UEFI capsule generation. Both public certificate and private key are used over pkcs11 protocol. Pkcs11-tool has been introduced as softhsm tool doesn't have functionality to import certificates in commonly distributed version (only in the latest). Signed-off-by: Wojciech Dubowik <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'tools/binman/btool')
-rw-r--r--tools/binman/btool/p11_kit.py21
-rw-r--r--tools/binman/btool/pkcs11_tool.py21
2 files changed, 42 insertions, 0 deletions
diff --git a/tools/binman/btool/p11_kit.py b/tools/binman/btool/p11_kit.py
new file mode 100644
index 00000000000..9d8d5d848b4
--- /dev/null
+++ b/tools/binman/btool/p11_kit.py
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright 2026 Mettler Toledo Technologies GmbH
+#
+"""Bintool implementation for p11-kit"""
+
+from binman import bintool
+
+
+class Bintoolp11_kit(bintool.Bintool):
+ """p11-kit -- support tool for pkcs#11 libraries"""
+ def __init__(self, name):
+ super().__init__('p11-kit',
+ 'Pkcs11 library modules tool',
+ version_args='list modules')
+
+ def fetch(self, method):
+ """Install p11-kit via APT """
+ if method != bintool.FETCH_BIN:
+ return None
+
+ return self.apt_install('p11-kit')
diff --git a/tools/binman/btool/pkcs11_tool.py b/tools/binman/btool/pkcs11_tool.py
new file mode 100644
index 00000000000..673c0ea0ac3
--- /dev/null
+++ b/tools/binman/btool/pkcs11_tool.py
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright 2026 Mettler Toledo Technologies GmbH
+#
+"""Bintool implementation for pkcs11-tool"""
+
+from binman import bintool
+
+
+class Bintoolpkcs11_tool(bintool.Bintool):
+ """pkcs11-tool -- support tool for managing pkcs#11 tokens"""
+ def __init__(self, name):
+ super().__init__('pkcs11-tool',
+ 'PKCS #11 tokens managing tool',
+ version_args='--show-info')
+
+ def fetch(self, method):
+ """Install opensc via APT """
+ if method != bintool.FETCH_BIN:
+ return None
+
+ return self.apt_install('opensc')