I have the following question: I bought the certificate of type A1 to issue electronic invoices in the city hall here in Florianopolis. I already integrated my entire system with the City Hall API and the way to generate NFe is very simple: I perform a POST containing an XML and the City Hall will generate the NFe.
My question is this: at the end of the XML file there are several lines that I need to fill in the format below. How do I generate these lines using PHP and the certificate of type A1? I searched a lot on the internet and did not figure out how to generate this final part of the XML file.
For example, at the end of the XML file I have to fill in a field like this:
<ds:Reference Id="RefElement-3.496850484729869E7" URI="">
How do I set the value of RefElement?
In another part of XML I need to fill in this line:
<ds:DigestValue>KsPAoHg2H0y/wSrrOGRihebcE/g=</ds:DigestValue>
How do I generate this value from my digital certificate A1?