1
I have the error: Invalid event signature. Only one 'Keyinfo/X509data' Element is required/allowed
Before that I received the error that should change the signature method Transform to:
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">
Before was:
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
link used as the basis for signing xml: https://blogs.msdn.microsoft.com/winsdk/2015/11/14/using-sha256-with-the-signedxml-class/
Note: After using the method to sign, I noticed that you do not create this part:
<KeyInfo>
<X509Data>
<X509Certificate>...</X509Certificate>
</X509Data>
</KeyInfo>
Can that be it? If yes what might be missing to create that part in XML?
I had the same problem, but in PHP, I will leave my solution on record if someone has the same difficulty. The error was in converting the pfx certificate. Converting the pfx certificate to pem must be via the following openssl command:
openssl pkcs12 -in /var/cert.pfx -out var/cert.pem -nodes
– Guilherme N