“Invalid provider type specified” CryptographicException when trying to load private key of certificate

前端 未结 18 2951
盖世英雄少女心
盖世英雄少女心 2020-11-29 22:04

I\'m trying to read the private key of a certificate which has been shared with me by a third-party service provider, so I can use it to encrypt some XML before sending it t

18条回答
  •  猫巷女王i
    2020-11-29 22:45

    I faced the same problem in our IIS app:

     System.Security.Cryptography.Pkcs.PkcsUtils.CreateSignerEncodeInfo(CmsSigner signer, Boolean silent)
        System.Security.Cryptography.Pkcs.SignedCms.Sign(CmsSigner signer, Boolean silent)
        System.Security.Cryptography.Pkcs.SignedCms.ComputeSignature(CmsSigner signer, Boolean silent)
    

    Regenerating certs as mentioned here didnt help. I also noticed that test console app works fine under pool user.

    Problem disappeared after clearing "Enable 32-bit Applications" setting for IIS app pool.

提交回复
热议问题