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:

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.

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.

  • Create New...