Signing multiple references and non-XML content in detached mode

Open
#149 25 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
security

Research direction

Start with XMLSigner.sign in detached mode and trace how reference_uri and uri_resolver are handled during signing. Reproduce the multiple-reference example, including non-XML referenced data, and compare it with the existing verification behavior. Done means the requested references and resolver behavior are supported or their limitation is clearly documented.

Written by the indexing model from the issue text.

Description

Hi

I am trying to port some C code to python that is signing an XML referencing another document, a so called detached signature.
I was told that it is possible to specify "detached" as signature method when creating XMLSigner.
But then I expected that I also had to supply an uri-resolver method to the sign method just like with the verify method to supply the data for the uri specified. Something like the following:

def my_uri_resolver(self, uri):
    if uri == 'uri1':
        return 'data for uri1'
    if uri == 'uri2':
        return 'data for uri2'
...
signer = XMLSigner()
signed = signer.sign(
    unsigned_xml, 
    key=my_key,
    passphrase=my_passphrase,
    cert=my_cert,
    reference_uri=['uri1', 'uri2'],
    uri_resolver=my_uri_resolver)
...

Am I missing something here?

Regards Asbjørn Oskal

Dominant language
Python
Stars
154
Forks
113
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from XML-Security/signxml

All issues in XML-Security/signxml

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.