Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xmldisg schemata #23

Open
highsource opened this issue Apr 29, 2019 · 9 comments
Open

Add xmldisg schemata #23

highsource opened this issue Apr 29, 2019 · 9 comments
Assignees
Milestone

Comments

@highsource
Copy link
Owner

No description provided.

@highsource highsource added this to the 1.4.1 milestone Apr 29, 2019
@highsource highsource self-assigned this Apr 29, 2019
@highsource
Copy link
Owner Author

CC @matteobaccan.

@matteobaccan
Copy link

matteobaccan commented Apr 29, 2019

I have make the first pull request with some files I have used for a project where I use XMLDSIG.

Now I have check better the specification about XMLDSIG 1.1 and XMLDISK 1.2

https://www.w3.org/TR/xmldsig-core1/#sec-xsdSchema

that use these XSDs

  1. http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd
    If you look inside is referenced http://www.w3.org/2000/09/xmldsig
    that is https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd

  2. https://www.w3.org/TR/xmldsig-core1/xmldsig11-schema.xsd
    that import http://www.w3.org/2000/09/xmldsig

  3. https://www.w3.org/TR/xmldsig-core1/xmldsig1-schema.xsd
    that include http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core.xsd
    and import http://www.w3.org/TR/xmldsig-core1/xmldsig11-schema.xsd (2)

and 2.0

https://www.w3.org/TR/xmldsig-core2/#sec-xsdSchema

that use these XSDs

  1. http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd
    like 1.1
  2. http://www.w3.org/TR/xmldsig-core1/xmldsig11-schema.xsd
    like 1.1
  3. http://www.w3.org/TR/xmldsig-core1/xmldsig1-schema.xsd
    like 1.1
  4. http://www.w3.org/TR/xmldsig-core2/xmldsig2-schema.xsd
    that import xmldsig-core-schema.xsd and xmldsig11-schema.xsd and add some specification.

I have attach the zip file with all these XSD
TR.ZIP
(I have no permission to push on this branch)

There is also this specification

https://www.w3.org/TR/xmldsig-core/#sec-xsdSchema

but I think is only an alias to

https://www.w3.org/TR/xmldsig-core1/#sec-xsdSchema

And also the schema

https://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd

is not the same, ma is very similar to

https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd

it's only a different revision (1.1 and 1.2)

I hope this can help you better understand this intricate schema architecture and imptove your project

All the best
Matteo Baccan

@highsource
Copy link
Owner Author

@matteobaccan Suggestion: let me do the schemas exactly as they are referenced in 1.1 and 2.0 specifications.

Do you have any sample XML files you could share? For testing purposes?

@matteobaccan
Copy link

matteobaccan commented Apr 30, 2019

You can use a public schema used in Italy for "fatture elettroniche"

At this page

https://www.fatturapa.gov.it/export/fatturazione/it/normativa/f-2.htm

Is referenced

https://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2.1/Schema_del_file_xml_FatturaPA_versione_1.2.1.xsd

that contains

<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>

There also some sample XML, but I don'y have find a valid signature.

I use this library In a project where I must to generated offline the java class schema I have used a catalog.cat with these directives

SYSTEM "http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd" "xmldsig-core-schema.xsd"
REWRITE_SYSTEM "http://www.w3.org" "maven:org.hisrc.w3c:w3c-schemas:jar::!/w3c"

And I have add a local xmldsig-core-schema.xsd, but if you include all in w3c-schemas.jar I can remove SYSTEM directive and do a full offline generation using only your jar

@matteobaccan
Copy link

matteobaccan commented Apr 30, 2019

@highsource
Copy link
Owner Author

@matteobaccan These schemas are buggy as hell:

https://twitter.com/orless/status/1123249634187595777

I had to patch a few things but now seem to be able to compile both 1.1 and 2.0.

highsource added a commit that referenced this issue Apr 30, 2019
highsource added a commit that referenced this issue Apr 30, 2019
highsource added a commit that referenced this issue Apr 30, 2019
highsource added a commit that referenced this issue Apr 30, 2019
highsource added a commit that referenced this issue Apr 30, 2019
@highsource
Copy link
Owner Author

@matteobaccan Please build/try the https://github.com/highsource/w3c-schemas/tree/issue-23 branch.

And if you happen to have an XML-DSig 2.0 example handy, I'd be grateful.

@matteobaccan
Copy link

Hi

I have try to use the snapshot and works in my projects.

I only suggest to you to add also this XSD

https://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd

This is due to the large use of this XSD insted of

https://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd

The two XSD are the same, for this reason, in some situation, there is a use of the 2002 reference and not the 2008 reference

For example: this is the XSD used in Italy by e-invoicing

https://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2.1/Schema_del_file_xml_FatturaPA_versione_1.2.1.xsd

all the best
matteo baccan

@matteobaccan
Copy link

Hi

have you planned the official new release of W3c-schemas with XMLDSIG support?

ciao
matteo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants