ds:X509Certificate in signed xml

87 Views Asked by At

I have an xml file to sign digitally.

I have created a private key using

openssl ecparam -name secp256k1 -genkey -noout -out privatekey.pem

Generated a public key using

openssl ec -in privatekey.pem -pubout -conv_form compressed -out publickey.pem

Again using privatekey.pem I generated a csr file and submitted to authority.

I have saved the result as CCSID.pem and converted into pfx file using:

openssl pkcs12 -inkey privatekey.pem -in CCSID.pem -export -passout pass:12345 -out CCSID.pfx

I am trying to sign my xml file using CCSID.pem file and the private key.

Here my questions:

  1. According to the specification, for ds:X509Certificate node I am supposed to add certificate. What I understand here is to read binary, convert to base64 and write here the output? Or this place is for the public key of the certificate?

  2. I am extracting the public key from pem and I expect that should be the same with the publickey.pem that I generated, but they do not match. What am I missing here?

I am following this document: "https://zatca.gov.sa/en/E-Invoicing/Introduction/Guidelines/Documents/E-Invoicing_Detailed__Guideline.pdf"

That way my signatures are failing. Please guide.

0

There are 0 best solutions below