The following code works correctly w/in a Windows .NET Form Application
SSLFTPCertificate clientCertificate = SSLFTPCertificate.CreateFromCER(certFileName);
clientCertificate.AssociatePrivateKey(prvKeyFileName, password);
However, in a Windows .NET Service, running as the same user and with the same filename/password/etc, gets the following Exception.
Org.Mentalis.Security.Certificates.CertificateException: Could not import the private key from the PVK file (s1hCg7vIb)
at oDxWX6UrVopxSDInbkS.TBRxOaUlH8guapN2NIa.sWNYYZ71sS(String , String , Boolean )
at oDxWX6UrVopxSDInbkS.TBRxOaUlH8guapN2NIa.RZjY1XWKoW(String , String )
at EnterpriseDT.Net.Ftp.Ssl.SSLFTPCertificate.AssociatePrivateKey(String pvkFileName, String password)
at CdrProcessing.EdtFtpClient.LoadClientCertificate() in C:\TMCApps\CdrProcessing\code\CdrProcessing\EdtFtpClient.cs:line 116
[Where the last line is the invocation of the AssociatedPrivateKey above]
Any help would be greatly appreciated.
Thanks,
James Smyth