创建IExternalSignature的对象时,它无法在Windows 7的win服务(WAS)中工作。但相同的代码在Windows 8中工作

时间:2018-09-24 11:55:15

标签: c# itext x509certificate2

IExternalSignature externalSignature = 
    new X509Certificate2Signature(certClient, "SHA-1");



Exception Occurred : 
            An internal error occurred.
   at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
   at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
   at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
   at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
   at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
   at iTextSharp.text.pdf.security.X509Certificate2Signature..ctor(X509Certificate2 certificate, String hashAlgorithm)
   at WindowsService_HostAPI.ValuesController.Post(SignPDF pdfin) in E:\Aditya share\Harshit\WindowsService_HostAPI IGR Set Up\WindowsService_HostAPI\ValuesController.cs:line 587
Source : mscorlib

0 个答案:

没有答案