selective-php / xmldsig

Sign XML Documents with Digital Signatures
MIT License
73 stars 34 forks source link

Issue a XML signature with custom tags #7

Closed howdoyouturn69 closed 3 years ago

howdoyouturn69 commented 3 years ago

Hi. First of all, thanks for your lib, in my initial test it work as expected.

Now, I'm looking to do a sightly different signature procedure, maybe you can enlighten me.

The tags used for the digital signature in your library are: Signature, SignedInfo, CanonicalizationMethod, SignatureMethod, etc...

I'm looking to renamed them like ds:Signature, ds:SignedInfo, ds:CanonicalizationMethod, ds:SignatureMethod, and so. Basically a prefix ds: in each tag.

How can I do this customization with your library? It is possible?

Also. before I finish the root tag Signature, additional signature fields has to be added. My XML file has a bit more complex structure, and those fields has an special signing procedure. I need to retrieve additional tags like ds:KeyInfo, <ds:X509Data, ds:X509Certificate, ds:KeyValue, ds:RSAKeyValue, ds:Modulus.

Is this possible (retrieve those extra tags with additional information of the signing process) with your library?

Where can I start for the customization.

Just in case, are you available to accept such paid customization job? Which is increase the information given for the sign procedure.

Thanks for your support and help. Regards.

odan commented 3 years ago

Hi @howdoyouturn69

I'm looking to renamed them like ds:Signature, ds:SignedInfo, ds:CanonicalizationMethod, ds:SignatureMethod, and so. Basically a prefix ds: in each tag. How can I do this customization with your library? It is possible?

Currently this is not supportet, but could be added as a new feature.

I need to retrieve additional tags like ds:KeyInfo, <ds:X509Data, ds:X509Certificate, ds:KeyValue, ds:RSAKeyValue, ds:Modulus.

These extra ds:KeyInfo element and all sub-nodes like ds:X509Data are also not supported.

Is this possible (retrieve those extra tags with additional information of the signing process) with your library?

This library provides only singing and validating functionality. To retrive such an XML node you could try to use the native PHP DOMXPath::query methods.

Where can I start for the customization.

This library does not provide much customization. When the community needs more features I will try to add it to the codebase.

As far as I know the robrichards/xmlseclibs provides all the features you are looking for. Have you already tried it?

howdoyouturn69 commented 3 years ago

Hi, thanks for your answers. yes I was capable to check robrichards work. And I decide to try yours first since it looks more clean, and easy to implement.

In any case, let me know if you're available for hire and customize.

Thanks.

odan commented 3 years ago

I appreciate your support. Here is my Ko-fi and donate link.