pyhanko-cli 0.2.1__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. pyhanko_cli-0.3.0/MANIFEST.in +1 -0
  2. {pyhanko_cli-0.2.1/src/pyhanko_cli.egg-info → pyhanko_cli-0.3.0}/PKG-INFO +4 -5
  3. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/certomancer_trust_lists.py +191 -0
  4. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/certomancer.yml +870 -0
  5. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/intermediate_ca.key.pem +9 -0
  6. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/ocsp.key.pem +9 -0
  7. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/params.pem +9 -0
  8. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/root_ca.key.pem +9 -0
  9. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/signer.key.pem +9 -0
  10. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/signer2.key.pem +9 -0
  11. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/tsa.key.pem +9 -0
  12. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-dsa/tsa2.key.pem +9 -0
  13. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/decrypter-x25519.key.pem +3 -0
  14. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/decrypter-x448.key.pem +4 -0
  15. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/decrypter1.key.pem +5 -0
  16. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/decrypter2.key.pem +6 -0
  17. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/decrypter3.key.pem +7 -0
  18. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/intermediate_ca.key.pem +9 -0
  19. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/ocsp.key.pem +9 -0
  20. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/root_ca.key.pem +9 -0
  21. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/signer.key.pem +9 -0
  22. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/signer2.key.pem +9 -0
  23. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/tsa.key.pem +9 -0
  24. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ecdsa/tsa2.key.pem +9 -0
  25. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed25519/intermediate_ca.key.pem +3 -0
  26. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed25519/ocsp.key.pem +3 -0
  27. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed25519/root_ca.key.pem +3 -0
  28. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed25519/signer.key.pem +3 -0
  29. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed25519/signer2.key.pem +3 -0
  30. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed25519/tsa.key.pem +3 -0
  31. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed25519/tsa2.key.pem +3 -0
  32. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed448/intermediate_ca.key.pem +4 -0
  33. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed448/ocsp.key.pem +4 -0
  34. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed448/root_ca.key.pem +4 -0
  35. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed448/signer.key.pem +4 -0
  36. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed448/signer2.key.pem +4 -0
  37. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed448/tsa.key.pem +4 -0
  38. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-ed448/tsa2.key.pem +4 -0
  39. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/indep_tsa.key.pem +27 -0
  40. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/indep_tsa_root.key.pem +27 -0
  41. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/interm_aa.key.pem +27 -0
  42. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/intermediate_ca.key.pem +30 -0
  43. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/leaf_aa.key.pem +27 -0
  44. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/ocsp.key.pem +30 -0
  45. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/root_aa.key.pem +27 -0
  46. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/root_ca.key.pem +30 -0
  47. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/signer.key.pem +30 -0
  48. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/signer2.key.pem +30 -0
  49. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/tsa.key.pem +30 -0
  50. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/keys-rsa/tsa2.key.pem +30 -0
  51. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/ocsp.req.der +0 -0
  52. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/ocsp.resp.der +0 -0
  53. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/real-misissued-qtst-cert.cer +0 -0
  54. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/real-qcert.cer +0 -0
  55. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/real-qtst-cert.cer +0 -0
  56. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/selfsigned.cert.pem +33 -0
  57. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/selfsigned.key.pem +54 -0
  58. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/selfsigned.pfx +0 -0
  59. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/some-chain.cert.pem +45 -0
  60. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/ca-chain.cert.pem +44 -0
  61. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/decrypter1-old.cert.pem +25 -0
  62. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/decrypter1.cert.pem +26 -0
  63. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/decrypter1.pfx +0 -0
  64. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/decrypter2.cert.pem +25 -0
  65. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/decrypter2.pfx +0 -0
  66. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/interm-ocsp.cert.pem +22 -0
  67. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/interm-ocsp.pfx +0 -0
  68. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/signer1-long.cert.pem +25 -0
  69. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/signer1-long.pfx +0 -0
  70. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/signer1.cert.pem +25 -0
  71. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/signer1.pfx +0 -0
  72. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/signer2.cert.pem +25 -0
  73. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/interm/signer2.pfx +0 -0
  74. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/interm.cert.pem +23 -0
  75. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/interm.pfx +0 -0
  76. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/root.cert.pem +21 -0
  77. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/root.pfx +0 -0
  78. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/tsa.cert.pem +23 -0
  79. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/tsa.pfx +0 -0
  80. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/tsa2.cert.pem +23 -0
  81. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca/root/tsa2.pfx +0 -0
  82. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca-setup/ca-setup.sh +273 -0
  83. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca-setup/openssl.base.cnf +116 -0
  84. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca-setup/pkcs11-setup-certomancer.sh +32 -0
  85. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca-setup/pkcs11-setup.sh +110 -0
  86. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/testing-ca-setup/setup-params +93 -0
  87. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/crypto/tsa.cert.pem +22 -0
  88. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/fonts/FreeSerif.otf +0 -0
  89. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/fonts/LICENSE.Noto +92 -0
  90. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/fonts/LICENSE.freeserif +29 -0
  91. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/fonts/NotoSans-Regular.ttf +0 -0
  92. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/fonts/NotoSansArabic-Regular.ttf +0 -0
  93. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/fonts/NotoSerifJP-Regular.otf +0 -0
  94. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/fonts/NotoSerifSubset.otf +0 -0
  95. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/img/stamp-indexed.png +0 -0
  96. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/img/stamp.png +0 -0
  97. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/.gitignore +1 -0
  98. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/broken-objstream1.pdf +0 -0
  99. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/broken-objstream2.pdf +0 -0
  100. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/broken-objstream3.pdf +0 -0
  101. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/broken-objstream4.pdf +0 -0
  102. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/broken-objstream5.pdf +0 -0
  103. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/broken-objstream6.pdf +0 -0
  104. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/certified-with-indirect-refs-in-dir.pdf +151 -0
  105. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/circular-page-tree.pdf +65 -0
  106. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/coverage-anomalies/base.pdf +122 -0
  107. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/coverage-anomalies/one-byterange.pdf +122 -0
  108. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/coverage-anomalies/signature-gap-too-big.pdf +123 -0
  109. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/coverage-anomalies/tail-uncovered.pdf +122 -0
  110. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/coverage-anomalies/weird-byterange.pdf +122 -0
  111. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/ed448-disallowed-hash.pdf +164 -0
  112. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/ed448-shake256-nolen.pdf +164 -0
  113. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/embedded-encrypted-nocf.pdf +0 -0
  114. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/empty-a4.pdf +56 -0
  115. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/extensions-direct.pdf +391 -0
  116. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/extensions-indirect-not-all-paths.pdf +412 -0
  117. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/extensions-indirect.pdf +395 -0
  118. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/extensions-update-direct.pdf +401 -0
  119. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/extensions-update-indirect.pdf +410 -0
  120. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/fontembed.pdf +0 -0
  121. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-tree-circular-ref-input.pdf +180 -0
  122. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-ap-indirect-sneaky-trailer.pdf +332 -0
  123. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-no-override-appearance-stream-ap-indirect-sneaky.pdf +331 -0
  124. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-no-override-appearance-stream-ap-indirect.pdf +330 -0
  125. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-original-ap-type-wrong.pdf +324 -0
  126. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-override-appearance-stream-ap-indirect-sneaky.pdf +315 -0
  127. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-override-appearance-stream-ap-indirect.pdf +314 -0
  128. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-override-appearance-stream-sneaky.pdf +313 -0
  129. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/form-update-override-appearance-stream.pdf +312 -0
  130. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/info-bin-producer-string.pdf +0 -0
  131. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/arabic-box.pdf +0 -0
  132. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/bitmap-bg.pdf +0 -0
  133. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/code128-test.pdf +228 -0
  134. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/double-newline.pdf +0 -0
  135. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/fancy-qr-stamp-test.pdf +0 -0
  136. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/form-fill-result.pdf +0 -0
  137. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/four-stamps-fixed.pdf +0 -0
  138. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/four-stamps-natural.pdf +0 -0
  139. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/freeserif-test.pdf +0 -0
  140. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/ja-vert-stamps.pdf +0 -0
  141. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/leaky-graphics-state-stamp-no-corr-result.pdf +0 -0
  142. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/leaky-graphics-state-stamp-result.pdf +0 -0
  143. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/scaled-bitmap-bg.pdf +0 -0
  144. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/stamp-from-static-pdf.pdf +124 -0
  145. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/stamp-on-pdf-bg.pdf +132 -0
  146. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/text-stamp-color.pdf +155 -0
  147. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/layout-tests/undef-bg-size.pdf +119 -0
  148. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/leaky-graphics-state-doc.pdf +0 -0
  149. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/malformed-encrypt-dict1.pdf +31 -0
  150. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/malformed-encrypt-dict2.pdf +31 -0
  151. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-aes256-empty-encrypted-string.pdf +0 -0
  152. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-aes256-malformed-oe.pdf +0 -0
  153. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-aes256-malformed-perms.pdf +0 -0
  154. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-aes256.pdf +0 -0
  155. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-annotless.pdf +99 -0
  156. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-badxref.pdf +57 -0
  157. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-broken-xref-size.pdf +87 -0
  158. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-hybrid-xref-mswordstyle.pdf +0 -0
  159. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-hybrid-xref-weirdgen.pdf +0 -0
  160. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-hybrid-xref.pdf +0 -0
  161. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-illegal-header.pdf +58 -0
  162. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-one-field-indir-annots.pdf +122 -0
  163. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-pdf-ua-and-a.pdf +0 -0
  164. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-pubkey-aes256.pdf +0 -0
  165. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-pubkey-rc4-envelope.pdf +87 -0
  166. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-pubkey-rc4.pdf +0 -0
  167. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-pubkey-unknown-envelope-alg.pdf +86 -0
  168. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-rc4.pdf +31 -0
  169. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-signed-twice-both-created.pdf +0 -0
  170. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-signed-twice-no-sig-type.pdf +281 -0
  171. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-signed-twice-second-created.pdf +0 -0
  172. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-hopeless.pdf +58 -0
  173. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-hopeless2.pdf +59 -0
  174. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-hopeless3.pdf +58 -0
  175. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-obo1.pdf +58 -0
  176. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-obo2.pdf +58 -0
  177. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-obo3.pdf +0 -0
  178. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-obo4.pdf +0 -0
  179. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-obo5.pdf +0 -0
  180. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-obo6.pdf +0 -0
  181. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-startxref-same-line.pdf +57 -0
  182. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-two-fields-aes256.pdf +0 -0
  183. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-two-fields-pubkey-aes256.pdf +0 -0
  184. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-two-fields-pubkey-rc4.pdf +0 -0
  185. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-two-fields-signed-twice.pdf +0 -0
  186. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-two-fields-tagged.pdf +0 -0
  187. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-two-fields.pdf +126 -0
  188. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-two-pages.pdf +87 -0
  189. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-field-aes256.pdf +0 -0
  190. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-field-pubkey-aes256.pdf +0 -0
  191. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-field-pubkey-rc4.pdf +0 -0
  192. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-field-rc4.pdf +39 -0
  193. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-field-tagged.pdf +0 -0
  194. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-field.pdf +115 -0
  195. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-nonexistent-refs.pdf +58 -0
  196. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-orphaned-xrefs.pdf +58 -0
  197. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-simple-form.pdf +164 -0
  198. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-textfield-group-var.pdf +183 -0
  199. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-with-textfield-group.pdf +180 -0
  200. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal-xref.pdf +0 -0
  201. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/minimal.pdf +58 -0
  202. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pades-lta-dss-indirect-arrs-test-2.pdf +626 -0
  203. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pades-lta-dss-indirect-arrs-test.pdf +491 -0
  204. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pades-with-old-style-signing-cert-attr-issser.pdf +137 -0
  205. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pades-with-old-style-signing-cert-attr.pdf +137 -0
  206. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/page-tree-direct-kid.pdf +62 -0
  207. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pdf-background-test.pdf +93 -0
  208. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pdf-sig-with-econtent.pdf +138 -0
  209. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pubkey-3des-test.pdf +0 -0
  210. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pubkey-ecc-test.pdf +0 -0
  211. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/pubkey-rc2-test.pdf +0 -0
  212. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/safedocs/CompactedPDFSyntaxTest.pdf +79 -0
  213. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/safedocs/SOURCE +1 -0
  214. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/scribble-decomp.pdf +94 -0
  215. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/scribble-in-arr.pdf +0 -0
  216. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/scribble.pdf +0 -0
  217. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/separate-annots-kids-indir.pdf +307 -0
  218. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/sig-no-signed-attrs.pdf +130 -0
  219. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/sig-with-ski-sid.pdf +0 -0
  220. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/signed-encrypted-pubkey-with-catalog-ref.pdf +0 -0
  221. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/source +25 -0
  222. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/struct-tree-circular-ref.pdf +0 -0
  223. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/pdf/uncompressed-objstream-sample.pdf +0 -0
  224. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/COPYRIGHT +7 -0
  225. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/eu-lotl-pivot-282.xml +2113 -0
  226. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/eu-lotl-pivot-300.xml +2113 -0
  227. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/eu-lotl-pivot-335.xml +2223 -0
  228. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/eu-lotl-pivot-341.xml +2189 -0
  229. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/eu-lotl.xml +2159 -0
  230. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/tsl-be.xml +6802 -0
  231. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/tl/tsl-ee.xml +4904 -0
  232. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/SOURCE +1 -0
  233. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/cyclic.xml +5 -0
  234. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/dtd.xml +7 -0
  235. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/external.xml +4 -0
  236. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/external_file.xml +4 -0
  237. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/quadratic.xml +4 -0
  238. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/simple-ns.xml +7 -0
  239. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/simple.xml +6 -0
  240. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/xmlbomb.xml +7 -0
  241. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/xmlbomb2.xml +4 -0
  242. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/data/xml/bad-xml/xmp-with-harmless-entity.xml +20 -0
  243. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/samples.py +166 -0
  244. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/__init__.py +0 -0
  245. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/csc_utils/__init__.py +0 -0
  246. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/csc_utils/csc_dummy_client.py +89 -0
  247. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/layout_test_utils.py +92 -0
  248. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/pkcs11_utils/__init__.py +0 -0
  249. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/pkcs11_utils/config.py +55 -0
  250. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/pkcs11_utils/fixtures.py +199 -0
  251. pyhanko_cli-0.3.0/pyhanko_testing_commons/test_utils/signing_commons.py +279 -0
  252. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/pyproject.toml +9 -21
  253. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/_root.py +3 -10
  254. pyhanko_cli-0.3.0/src/pyhanko/cli/commands/__init__.py +0 -0
  255. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/signing/pkcs11_cli.py +35 -1
  256. pyhanko_cli-0.3.0/src/pyhanko/cli/py.typed +0 -0
  257. pyhanko_cli-0.3.0/src/pyhanko/cli/version.py +2 -0
  258. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0/src/pyhanko_cli.egg-info}/PKG-INFO +4 -5
  259. pyhanko_cli-0.3.0/src/pyhanko_cli.egg-info/SOURCES.txt +294 -0
  260. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko_cli.egg-info/requires.txt +2 -2
  261. pyhanko_cli-0.3.0/tests/test_cli_crypt.py +548 -0
  262. pyhanko_cli-0.3.0/tests/test_cli_field_mgmt.py +175 -0
  263. pyhanko_cli-0.3.0/tests/test_cli_ltv.py +249 -0
  264. pyhanko_cli-0.3.0/tests/test_cli_plugins.py +158 -0
  265. pyhanko_cli-0.3.0/tests/test_cli_signing.py +1490 -0
  266. pyhanko_cli-0.3.0/tests/test_cli_signing_pkcs11.py +362 -0
  267. pyhanko_cli-0.3.0/tests/test_cli_stamp.py +278 -0
  268. pyhanko_cli-0.3.0/tests/test_config.py +1344 -0
  269. pyhanko_cli-0.3.0/tests/test_runtime.py +136 -0
  270. pyhanko_cli-0.2.1/MANIFEST.in +0 -5
  271. pyhanko_cli-0.2.1/src/pyhanko/cli/version.py +0 -2
  272. pyhanko_cli-0.2.1/src/pyhanko_cli.egg-info/SOURCES.txt +0 -34
  273. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/LICENSE +0 -0
  274. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/README.md +0 -0
  275. {pyhanko_cli-0.2.1/src/pyhanko/cli/commands → pyhanko_cli-0.3.0/pyhanko_testing_commons}/__init__.py +0 -0
  276. /pyhanko_cli-0.2.1/src/pyhanko/cli/py.typed → /pyhanko_cli-0.3.0/pyhanko_testing_commons/test_data/__init__.py +0 -0
  277. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/setup.cfg +0 -0
  278. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/__main__.py +0 -0
  279. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/__init__.py +0 -0
  280. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/_ctx.py +0 -0
  281. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/_trust.py +0 -0
  282. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/cache.py +0 -0
  283. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/crypt.py +0 -0
  284. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/fields.py +0 -0
  285. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/signing/__init__.py +0 -0
  286. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/signing/plugin.py +0 -0
  287. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/signing/simple.py +0 -0
  288. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/signing/utils.py +0 -0
  289. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/stamp.py +0 -0
  290. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/validation/__init__.py +0 -0
  291. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/validation/ltv.py +0 -0
  292. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/commands/validation/validate.py +0 -0
  293. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/config.py +0 -0
  294. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/plugin_api.py +0 -0
  295. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/runtime.py +0 -0
  296. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko/cli/utils.py +0 -0
  297. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko_cli.egg-info/dependency_links.txt +0 -0
  298. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko_cli.egg-info/entry_points.txt +0 -0
  299. {pyhanko_cli-0.2.1 → pyhanko_cli-0.3.0}/src/pyhanko_cli.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ graft pyhanko_testing_commons
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyhanko-cli
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: CLI tools for stamping and signing PDF files
5
5
  Author-email: Matthias Valvekens <dev@mvalvekens.be>
6
6
  Maintainer-email: Matthias Valvekens <dev@mvalvekens.be>
@@ -15,7 +15,6 @@ Classifier: Development Status :: 4 - Beta
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
@@ -23,13 +22,13 @@ Classifier: Programming Language :: Python :: 3.13
23
22
  Classifier: Programming Language :: Python :: 3.14
24
23
  Classifier: Topic :: Security :: Cryptography
25
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
- Requires-Python: >=3.9
25
+ Requires-Python: >=3.10
27
26
  Description-Content-Type: text/markdown
28
27
  License-File: LICENSE
29
28
  Requires-Dist: asn1crypto>=1.5.1
30
29
  Requires-Dist: tzlocal>=4.3
31
- Requires-Dist: pyhanko<0.33,>=0.32.0
32
- Requires-Dist: pyhanko-certvalidator<0.30,>=0.29.0
30
+ Requires-Dist: pyhanko<0.35,>=0.34.0
31
+ Requires-Dist: pyhanko-certvalidator<0.31,>=0.30.0
33
32
  Requires-Dist: click!=8.2.0,>=8.1.3
34
33
  Requires-Dist: platformdirs>=4.3.8
35
34
  Dynamic: license-file
@@ -0,0 +1,191 @@
1
+ from typing import List, Tuple
2
+ from urllib.parse import urlparse
3
+
4
+ from aiohttp.test_utils import TestClient
5
+ from aiohttp.typedefs import StrOrURL
6
+ from asn1crypto import pem
7
+ from certomancer import PKIArchitecture
8
+ from certomancer.registry import CertLabel, EntityLabel
9
+ from cryptography.hazmat.primitives import serialization
10
+ from lxml.etree import fromstring, tostring
11
+ from pyhanko.generated.etsi import MimeType, ts_119612
12
+ from pyhanko.sign.validation.qualified.eutl_parse import (
13
+ ETSI_TSL_MIME_TYPE,
14
+ STATUS_GRANTED,
15
+ )
16
+ from pyhanko.sign.validation.qualified.tsp import CA_QC_URI, QTST_URI
17
+ from signxml import SignatureMethod
18
+ from signxml.xades import XAdESSigner
19
+ from xsdata.formats.dataclass.serializers import XmlSerializer
20
+ from xsdata.formats.dataclass.serializers.config import SerializerConfig
21
+ from xsdata.models.datatype import XmlDateTime
22
+ from yarl import URL
23
+
24
+
25
+ def _certomancer_pki_as_service_definitions(pki_arch: PKIArchitecture):
26
+ # register all self-issued certs as CAs
27
+ for iss, certs in pki_arch.enumerate_certs_by_issuer():
28
+ for cert_spec in certs:
29
+ if iss != cert_spec.subject:
30
+ continue
31
+ name = f"{pki_arch.arch_label}: CA {cert_spec.label}"
32
+ yield ts_119612.TSPService(
33
+ ts_119612.ServiceInformation(
34
+ service_type_identifier=ts_119612.ServiceTypeIdentifier(
35
+ CA_QC_URI
36
+ ),
37
+ service_name=ts_119612.InternationalNamesType(
38
+ (
39
+ ts_119612.MultiLangNormStringType(
40
+ value=name,
41
+ lang="en",
42
+ ),
43
+ )
44
+ ),
45
+ service_digital_identity=ts_119612.ServiceDigitalIdentity(
46
+ (
47
+ ts_119612.DigitalIdentityType(
48
+ x509_certificate=pki_arch.get_cert(
49
+ cert_spec.label
50
+ ).dump()
51
+ ),
52
+ )
53
+ ),
54
+ service_status=ts_119612.ServiceStatus(STATUS_GRANTED),
55
+ status_starting_time=XmlDateTime.from_datetime(
56
+ cert_spec.validity.valid_from
57
+ ),
58
+ )
59
+ )
60
+
61
+ for tsa_info in pki_arch.service_registry.list_time_stamping_services():
62
+ name = f"{pki_arch.arch_label}: TSA {tsa_info.label}"
63
+ yield ts_119612.TSPService(
64
+ ts_119612.ServiceInformation(
65
+ service_type_identifier=ts_119612.ServiceTypeIdentifier(
66
+ QTST_URI
67
+ ),
68
+ service_name=ts_119612.InternationalNamesType(
69
+ (
70
+ ts_119612.MultiLangNormStringType(
71
+ value=name,
72
+ lang="en",
73
+ ),
74
+ )
75
+ ),
76
+ service_digital_identity=ts_119612.ServiceDigitalIdentity(
77
+ (
78
+ ts_119612.DigitalIdentityType(
79
+ x509_certificate=pki_arch.get_cert(
80
+ tsa_info.signing_cert
81
+ ).dump()
82
+ ),
83
+ )
84
+ ),
85
+ service_status=ts_119612.ServiceStatus(STATUS_GRANTED),
86
+ status_starting_time=XmlDateTime.from_datetime(
87
+ pki_arch.get_cert_spec(
88
+ tsa_info.signing_cert
89
+ ).validity.valid_from
90
+ ),
91
+ )
92
+ )
93
+
94
+
95
+ def _sign_tl(
96
+ xml_root: ts_119612.TrustServiceStatusList,
97
+ pki_arch: PKIArchitecture,
98
+ tlso_entity: EntityLabel,
99
+ ):
100
+ tlso_cert_label = pki_arch.get_unique_cert_for_entity(tlso_entity)
101
+ tlso_cert_spec = pki_arch.get_cert_spec(tlso_cert_label)
102
+ tlso_priv_key = pki_arch.key_set.get_private_key(tlso_cert_spec.subject_key)
103
+
104
+ priv_key = serialization.load_der_private_key(
105
+ tlso_priv_key.dump(), password=None
106
+ )
107
+
108
+ config = SerializerConfig(indent=" ")
109
+ data = XmlSerializer(config=config).render(xml_root)
110
+ data_read_back = fromstring(data.encode('utf8'))
111
+ signed = XAdESSigner(signature_algorithm=SignatureMethod.ECDSA_SHA256).sign(
112
+ data_read_back,
113
+ key=priv_key,
114
+ cert=pem.armor(
115
+ "CERTIFICATE", pki_arch.get_cert(tlso_cert_label).dump()
116
+ ),
117
+ always_add_key_value=False,
118
+ )
119
+ return tostring(signed).decode('utf8')
120
+
121
+
122
+ def certomancer_pki_as_trusted_list(
123
+ pki_arch: PKIArchitecture, tlso_entity: EntityLabel
124
+ ):
125
+ xml_root = ts_119612.TrustServiceStatusList(
126
+ scheme_information=ts_119612.SchemeInformation(),
127
+ trust_service_provider_list=ts_119612.TrustServiceProviderList(
128
+ trust_service_provider=tuple(
129
+ ts_119612.TrustServiceProvider(
130
+ tspservices=ts_119612.TSPServices((svc,))
131
+ )
132
+ for svc in _certomancer_pki_as_service_definitions(pki_arch)
133
+ )
134
+ ),
135
+ )
136
+ return _sign_tl(xml_root, pki_arch, tlso_entity)
137
+
138
+
139
+ def certomancer_lotl(
140
+ pki_arch: PKIArchitecture,
141
+ lotl_tlso_entity: EntityLabel,
142
+ entries: List[Tuple[CertLabel, str, str]],
143
+ ):
144
+ pointers = [
145
+ ts_119612.OtherTSLPointer(
146
+ tsllocation=url,
147
+ service_digital_identities=ts_119612.ServiceDigitalIdentities(
148
+ service_digital_identity=(
149
+ ts_119612.ServiceDigitalIdentity(
150
+ (
151
+ ts_119612.DigitalIdentityType(
152
+ x509_certificate=pki_arch.get_cert(
153
+ tlso_cert
154
+ ).dump()
155
+ ),
156
+ )
157
+ ),
158
+ )
159
+ ),
160
+ additional_information=ts_119612.AdditionalInformation(
161
+ other_information=(
162
+ ts_119612.AnyType(
163
+ content=(
164
+ ts_119612.SchemeTerritory(territory),
165
+ MimeType(ETSI_TSL_MIME_TYPE),
166
+ )
167
+ ),
168
+ ),
169
+ ),
170
+ )
171
+ for tlso_cert, territory, url in entries
172
+ ]
173
+
174
+ xml_root = ts_119612.TrustServiceStatusList(
175
+ scheme_information=ts_119612.SchemeInformation(
176
+ scheme_information_uri=ts_119612.SchemeInformationURI(uri=tuple()),
177
+ pointers_to_other_tsl=ts_119612.PointersToOtherTSL(
178
+ other_tslpointer=tuple(pointers)
179
+ ),
180
+ ),
181
+ )
182
+ return _sign_tl(xml_root, pki_arch, lotl_tlso_entity)
183
+
184
+
185
+ class PathRetainingClient(TestClient):
186
+ def make_url(self, path: StrOrURL) -> URL:
187
+ components = urlparse(path)
188
+ # only remember the path part, forget about the host etc.
189
+ # (this is so we can test with real EUTL files using aiohttp
190
+ # testing utils)
191
+ return super().make_url(components.path)