Skip to content

Commit

Permalink
Some clarification in interrupted signing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Sep 25, 2023
1 parent 5e3f35f commit 82824a5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/lib-guide/signing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,9 @@ describe the most common use case: a scenario where pyHanko prepares a document
computes the digest, sends it off to somewhere else for signing, and finishes the signing process
once the response comes in (potentially in an entirely different thread).

Basic interrupted signing example
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In the example scenario, we use :class:`~pyhanko.sign.signers.pdf_cms.ExternalSigner` to format the
signed attributes and the final CMS object, but the same principle applies (mutatis mutandis) to
remote signers that supply complete CMS objects.
Expand Down Expand Up @@ -866,10 +869,17 @@ In particular, you don't have to bother with
:class:`~pyhanko.sign.signers.pdf_signer.PostSignInstructions` at all.


Interrupted signing when the signer's certificate is not known a priori
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Note that, starting with pyHanko ``0.14.0``, the signer's certificate need no
longer be provided at the start of the signing process, if you supply some
additional parameters yourself. Here's what that might look like in a toy
example.
additional parameters yourself. This is useful in situations involving integrating
with a remote signing service that only provisions a short-lived certificate
when provided with a hash of the document (typically, such signers respond with
complete CMS signature containers).

Here's what that might look like in a toy example.

.. code-block:: python
Expand All @@ -879,6 +889,7 @@ example.
# is necessary if the signing cert is not available
signers.PdfSignatureMetadata(
field_name='Signature',
md_algorithm='sha256',
),
signer=ExternalSigner(
# note the 'None's
Expand Down

0 comments on commit 82824a5

Please sign in to comment.