Skip to content

Commit

Permalink
signer: Add note about unhandled exceptions
Browse files Browse the repository at this point in the history
There is (at least currently) no promise that Signer
implementations do not raise unexpected errors.
  • Loading branch information
jku committed Nov 29, 2022
1 parent c3c1ca8 commit 98442f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions securesystemslib/signer/_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class Signer:
signer = Signer.from_priv_key_uri("envvar:MYPRIVKEY", pub_key)
sig = signer.sign(b"data")
Note that signer implementations may raise errors (during both
Signer.from_priv_key_uri() and Signer.sign()) that are not documented here:
examples could include network errors or file read errors. Applications
should use generic try-except here if unexpected raises are not an option.
See SIGNER_FOR_URI_SCHEME for supported private key URI schemes. The
currently supported default schemes are:
* envvar: see SSlibSigner for details
Expand Down

0 comments on commit 98442f5

Please sign in to comment.