Skip to content

feat: X509 in MSO signer and further coeherence checks#35

Merged
peppelinux merged 5 commits into
IdentityPython:mainfrom
peppelinux:x5chain
Jul 21, 2026
Merged

feat: X509 in MSO signer and further coeherence checks#35
peppelinux merged 5 commits into
IdentityPython:mainfrom
peppelinux:x5chain

Conversation

@peppelinux

Copy link
Copy Markdown
Member

This pull request adds support for issuing Mobile Security Objects (MSOs) and mDOCs with a full X.509 certificate chain in the COSE x5chain header (label 33), following RFC 9360. It introduces a new x509_chain parameter to both MsoIssuer and MdocCborIssuer.new(), allowing flexible input types (file paths, bytes, or Certificate objects), and ensures cert_path and x509_chain are mutually exclusive. The update is thoroughly documented and tested, improving standards compliance and interoperability.

X.509 Chain Support and API Changes

  • Added x509_chain parameter to MsoIssuer and MdocCborIssuer.new() for embedding a full X.509 certificate chain in the COSE x5chain header (label 33), supporting file paths, bytes, or Certificate objects as input. cert_path and x509_chain are now mutually exclusive. [1] [2] [3] [4] [5] [6] [7]
  • Refactored MSO signing logic to use the new encode_x5chain utility for encoding the chain, supporting both single and multiple certificates per RFC 9360.

X.509 Utility Functions

  • Added X509ChainSource type and utility functions (load_x509_certificates_from_bytes, load_x509_certificates_from_source, encode_x5chain) to handle flexible loading and encoding of X.509 chains for COSE headers.

Testing Enhancements

  • Introduced comprehensive tests for the new x509_chain functionality, including single and multiple certificate chains, mutual exclusivity with cert_path, and integration with both MsoIssuer and MdocCborIssuer. [1] [2]

Documentation Updates

  • Updated and expanded documentation in README.md, docs/CERTIFICATE-CHAIN-VERIFICATION.md, and docs/MSO.md to describe the new x509_chain parameter, usage patterns, and RFC 9360 compliance. [1] [2] [3]

Other Improvements

  • Updated version to 1.3.0.
  • Improved robustness of cborlist2CoseSign1 to accept both lists and tuples.

peppelinux and others added 4 commits June 11, 2026 14:32
Resolve conflicts keeping x5chain 1.4.0 and X509 chain support while
adopting main's cbor2 6 thaw helpers and UTC validity same-day test.

Co-authored-by: Cursor <cursoragent@cursor.com>
Format x509 imports for isort and mark illustrative x509_chain
snippets as non-runnable so run_doc_examples skips incomplete blocks.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 82.97872% with 16 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@07eaec5). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pymdoccbor/x509.py 51.85% 13 Missing ⚠️
pymdoccbor/mso/issuer.py 80.00% 2 Missing ⚠️
pymdoccbor/tests/test_06_mso_issuer.py 98.18% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #35   +/-   ##
=======================================
  Coverage        ?   91.26%           
=======================================
  Files           ?       27           
  Lines           ?     1190           
  Branches        ?        0           
=======================================
  Hits            ?     1086           
  Misses          ?      104           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peppelinux
peppelinux merged commit 70c9390 into IdentityPython:main Jul 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants