I've implemented EWP on PayPal using the .Net 2.0 framework and X509
certificates, On my local system everything works well.
On the hosting server I'm getting this error:
The system cannot find the file specified.
Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error
and where it originated in the code.
Exception Details:
System.Security.Cryptography.CryptographicException: The system cannot
find the file specified.
[CryptographicException: The system cannot find the file specified.
]
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) +33
System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx) +0
System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags) +228
System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) +130
MyDom.ButtonEncryption.LoadSignerCredential(String signerPfxCertPath, String signerPfxCertPassword) in C:\Data\InetPub\wwwroot\MyDom\Basket\ButtonEncryption.cs:68
MyDom.EWPServices.EncryptButton(String buttonParams, HttpServerUtility Server) in C:\Data\InetPub\wwwroot\MyDom\Basket\EWPServices.cs:101
[Exception: The system cannot find the file specified.
]
and the stack trace shows that the error is on the line:
_signerCert =new X509.X509Certificate2(signerPfxCertPath, signerPfxCertPassword);
I can read all the files using StreamReader.
Can any one please help me???