Skip to content

Commit b42c093

Browse files
committed
Raise error when invalid cert is passed
1 parent 9fd22ff commit b42c093

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

signxml/signer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ def sign(
198198

199199
if isinstance(cert, (str, bytes)):
200200
cert_chain = list(iterate_pem(cert))
201+
if len(cert_chain) == 0:
202+
raise InvalidInput("No PEM-encoded certificates found in string cert input data")
201203
else:
202204
cert_chain = cert # type: ignore
203205

0 commit comments

Comments
 (0)