I am generating an XML where at the moment of embedding the Certificate it must go in a certain encoding that, despite the fact that I have searched, I have not been able to generate it.
Taking a valid XML as an example, I have noted that the embedded Certificate presents instead of the line break , the encoding:
Therefore, in my XMLs I have tried to place said element with:
$certData= file_get_contents("/ruta/archivo.cer");
wordwrap($certData, 76, "\r\n", true);
But this only gives me the , how can I place: ??
Here Valid XML:
MIIIoTCCBomgAwIBAgIIW6qCaBJlC8wwDQYJKoZIhvcNAQELBQAwgbQxIzAhBgkqhkiG9w0BCQEW FGluZm9AYW5kZXNzY2QuY29tLmNvMSMwIQYDVQQDExpDQSBBTkRFUyBTQ0QgUy5BLiBDbGFzZSBJ
Here MY Invalid Xml (output):
MIIIoTCCBomgAwIBAgIIW6qCaBJlC8wwDQYJKoZIhvcNAQELBQAwgbQxIzAhBgkqhkiG9w0BCQEW FGluZm9AYW5kZXNzY2QuY29tLmNvMSMwIQYDVQQDExpDQSBBTkRFUyBTQ0QgUy5BLiBDbGFzZSBJ
Subject to knowing how you're printing the control characters, any of:
wordwrap($certData, 76, chr(13), true);
wordwrap($certData, 76, ' ', true);