From: Bastian Krause <bst@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Bastian Krause <bst@pengutronix.de>, Roland Hieber <rhi@pengutronix.de>
Subject: [ptxdist] [PATCH v3 6/6] doc: introduce ref_code_signing_helpers
Date: Wed, 17 Jun 2020 16:31:25 +0200 [thread overview]
Message-ID: <20200617143125.23999-7-bst@pengutronix.de> (raw)
In-Reply-To: <20200617143125.23999-1-bst@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Reviewed-by: Roland Hieber <rhi@pengutronix.de>
Tested-by: Ladislav Michl <ladis@linux-mips.org>
---
Changes since v2:
- remove "necessary package dependencies for code signing provider",
generated code signing providers now select all necessary host tools
by default
Changes since (implicit) v1:
- rebased on master
- split into sections: {SoftHSM Provider,Generic Provider,Consumer} Functions
- add introductory sentence for each section
---
doc/ref_code_signing_helpers.rst | 248 +++++++++++++++++++++++++++++++
doc/ref_manual.rst | 1 +
2 files changed, 249 insertions(+)
create mode 100644 doc/ref_code_signing_helpers.rst
diff --git a/doc/ref_code_signing_helpers.rst b/doc/ref_code_signing_helpers.rst
new file mode 100644
index 000000000..c3ffe01cb
--- /dev/null
+++ b/doc/ref_code_signing_helpers.rst
@@ -0,0 +1,248 @@
+.. _code_signing_helper_functions:
+
+Code Signing Helper Functions
+-----------------------------
+
+PTXdist provides various bash helper functions to be used in :ref:`code signing
+providers <code_signing_providers>` and :ref:`code signing consumers
+<code_signing_consumers>`.
+
+PTXdist stores URIs and CAs using these helpers in
+``$(PTXDIST_SYSROOT_HOST)/var/lib/keys/<signing-provider>/<role>/{uri,ca.pem}``.
+
+SoftHSM Provider Functions
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These helpers initialize and import public/private keys and certificates into
+the SoftHSM.
+
+.. _cs_init_softhsm:
+
+cs_init_softhsm
+^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_init_softhsm
+
+Initialize SoftHSM, and set the initial pins.
+
+cs_import_cert_from_der
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_import_cert_from_der <role> <DER>
+
+Import certificate from a given DER file for role.
+To be used with SoftHSM only.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+- SoftHSM must have been initialized (see :ref:`cs_init_softhsm`)
+
+cs_import_cert_from_pem
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_import_cert_from_pem <role> <PEM>
+
+Import certificate from a given PEM file for role.
+To be used with SoftHSM only.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+- SoftHSM must have been initialized (see :ref:`cs_init_softhsm`)
+
+cs_import_pubkey_from_pem
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_import_pubkey_from_pem <role> <PEM>
+
+Import public key from a given PEM file for role.
+To be used with SoftHSM only.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+- SoftHSM must have been initialized (see :ref:`cs_init_softhsm`)
+
+cs_import_privkey_from_pem
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_import_privkey_from_pem <role> <PEM>
+
+Import private key from a given PEM file for role.
+To be used with SoftHSM only.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+- SoftHSM must have been initialized (see :ref:`cs_init_softhsm`)
+
+cs_import_key_from_pem
+^^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_import_key_from_pem <role> <PEM>
+
+Import private/public key pair from a given PEM file for role.
+To be used with SoftHSM only.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+- SoftHSM must have been initialized (see :ref:`cs_init_softhsm`)
+
+Generic Provider Functions
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These helpers allow to define roles, set PKCS#11 URIs and handle certificate
+authorities (CAs).
+HSM as well as SoftHSM code signing providers should use them.
+
+.. _cs_define_role:
+
+cs_define_role
+^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_define_role <role>
+
+Define new key role.
+
+A default PKCS#11 URI is set implicitly as convenience for SoftHSM use cases.
+
+.. _cs_set_uri:
+
+cs_set_uri
+^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_set_uri <role> <URI>
+
+Set given PKCS#11 URI for role.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+
+.. _cs_append_ca_from_pem:
+
+cs_append_ca_from_pem
+^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_append_ca_from_pem <role> <PEM>
+
+Append certificate from a given PEM file for role.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+
+.. _cs_append_ca_from_der:
+
+cs_append_ca_from_der
+^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_append_ca_from_der <role> <DER>
+
+Append certificate from a given DER file for role.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+
+.. _cs_append_ca_from_uri:
+
+cs_append_ca_from_uri
+^^^^^^^^^^^^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_append_ca_from_uri <role> [<URI>]
+
+Append certificate from a given PKCS#11 URI for role.
+If URI is omitted the already set URI for role is used.
+
+Preconditions:
+
+- the role must have been defined (see :ref:`cs_define_role`)
+
+Consumer Functions
+~~~~~~~~~~~~~~~~~~
+
+Packages that want to sign something or need access to keys/CAs can retrieve
+PKCS#11 URIs and CAs with these helpers.
+
+.. _cs_get_uri:
+
+cs_get_uri
+^^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_get_uri <role>
+
+Get PKCS#11 URI for role.
+
+Preconditions:
+
+- the URI must have been set (see :ref:`cs_set_uri`)
+
+.. _cs_get_ca:
+
+cs_get_ca
+^^^^^^^^^
+
+Usage:
+
+.. code-block:: bash
+
+ cs_get_ca <role>
+
+Get path to the CA in PEM format for role.
+
+Preconditions:
+
+- a certificate must have been appended to the CA
+ (see :ref:`cs_append_ca_from_pem`, :ref:`cs_append_ca_from_der`,
+ :ref:`cs_append_ca_from_uri`)
diff --git a/doc/ref_manual.rst b/doc/ref_manual.rst
index 850d72399..dea1610c6 100644
--- a/doc/ref_manual.rst
+++ b/doc/ref_manual.rst
@@ -7,3 +7,4 @@ PTXdist Reference
ref_make_macros
ref_rule_file_layout
ref_parameter
+ ref_code_signing_helpers
--
2.27.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
next prev parent reply other threads:[~2020-06-17 14:31 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 14:31 [ptxdist] [PATCH v3 0/6] Add code-signing-provider template, add code signing docs Bastian Krause
2020-06-17 14:31 ` [ptxdist] [PATCH v3 1/6] ptxd_lib_template: add ptxd_template_read_options Bastian Krause
2020-06-19 6:24 ` Michael Olbrich
2020-06-19 8:13 ` Bastian Krause
2020-06-19 22:04 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` [ptxdist] [PATCH v3 2/6] package templates: add code-signing-provider template Bastian Krause
2020-06-18 11:40 ` Roland Hieber
2020-06-18 11:50 ` Bastian Krause
2020-06-19 6:12 ` Michael Olbrich
2020-06-19 6:28 ` Michael Olbrich
2020-06-19 7:52 ` Bastian Krause
2020-06-19 22:04 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-09-24 10:04 ` [ptxdist] [PATCH v3 2/6] " Ladislav Michl
2020-09-24 11:05 ` Bastian Krause
2020-09-24 11:15 ` Ladislav Michl
2020-09-24 12:23 ` Bastian Krause
2020-06-17 14:31 ` [ptxdist] [PATCH v3 3/6] doc: dev_manual: split up into multiple files Bastian Krause
2020-06-19 22:04 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` [ptxdist] [PATCH v3 4/6] doc: move code signing docs from scripts/ into doc/ Bastian Krause
2020-06-19 22:04 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` [ptxdist] [PATCH v3 5/6] doc: dev_code_signing: rework and extend code signing section Bastian Krause
2020-06-19 22:04 ` [ptxdist] [APPLIED] " Michael Olbrich
2020-06-17 14:31 ` Bastian Krause [this message]
2020-06-19 22:04 ` [ptxdist] [APPLIED] doc: introduce ref_code_signing_helpers Michael Olbrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200617143125.23999-7-bst@pengutronix.de \
--to=bst@pengutronix.de \
--cc=ptxdist@pengutronix.de \
--cc=rhi@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox