I created a web service that receives a .p12 file as a Byte Array and parses it as X509Certificate, when I tested it locally it worked just fine, but when I deployed it I'm getting the following error when trying to create the X509Certificate:
The system cannot find the file specified.
The code
//cerBytes is a Byte[] and passCert is a String
X509Certificate2 cert = new X509Certificate2(certBytes, passCert);
As I read, the problem is that it's trying to read the Certificate from the actual server, which is not the behaviour I'm looking for, I just need to parse the certificate from the Byte Array (that come from different senders/customers) sign an XML and that's it, There's no need to store the Certificate in the server.
Is there anyway to accomplish what I'm looking for?