Hey everyone,


I have a XIF that returns if the password of a digital certificate is valid or not. For that I'm using the "System.Security.Cryptography.X509Certificates" .NET assembly.


One of the entry inputs of the XIF is the certificate's binary data. When I read the byte array from a .pfx file in my desktop using a console application, the code works perfectly. Alltought, when I use the upload widget from Outsystems and define the Upload.Content as the binary data that is passed to the XIF, it doesn't work. It seems to have an error in the certificate content.


Any guess about what's going wrong?


Thank you very much.

Hi Fernanda,

Can you share more details about the error you get?

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Fernanda,

Can you share more details about the error you get?

Regards,

Daniel


Hi Daniel, 


The error message returned is "An internal error occurred". It occurs in this line of the C# code: X509Certificate2 cert = new X509Certificate2 (ssCertificateBinaryData, ssCertificatePassword, X509KeyStorageFlags.PersistKeySet). I've checked the input parameters and they are all correct. 


Best regards.

Hi Fernanda,

The error "An internal error occured" is not enough information to find the root cause.

The call stack would be very usefull to look at, which could for example be that the password is not correct.

Now I can't tell.

But given the fact that you mentioned that it does work when you test it using a console application, my first bet would be that the input parameters are causing the problem.

Regards,

Daniel