Jump to content

Signing a xml with specific structure


japs

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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...