Jump to content

Signing a xml with specific structure


Recommended Posts

I´ve been searching on how to do this but with no luck, the thing is, i need to sign a certificate and the xml result must match the example below:
 
<Signer>
 <dsig:X509IssuerName>dnQualifier=wBz3yptkPxbHI/\+LUUeH5R6rQfI=,CN=.cc-admin-x,
 OU=.cc-ra-1a.s430-2.ca.example.com,O=.ca.example.com</dsig:X509IssuerName>
 <dsig:X509SerialNumber>6992</dsig:X509SerialNumber>
</Signer>

The first thing i did was to create a private.key and a some_file.pem using PHP written on the first example here and i did it successfully. Then, i used this library(robrichards/xmlseclibs) to sign the certificate and everything went ok, but the final result is not the same, the differences are:

  • The sign portion appears at the end of the file
  • The hash string is enormous instead of the 29 caracters shown in the example
  • The dnQualifier, CN=, OU= and O do not appear on the xml even if i did fill them when creating the .pem file
  • Finally the X509SerialNumber does not appear to.

To create the xml i´m using the new DomDocument and i´m quite new doing this, could anyone point me out in the right direction?

Regards, thanks for your time.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...