c# - 始终加密 : Failed to decrypt a column encryption key using key store provider: 'MSSQL_CERTIFICATE_STORE'

标签 c# wcf encryption always-encrypted

我在我的 Web 应用程序中执行始终加密,该应用程序通过窗口服务托管的 WCF 服务插入数据。将数据插入加密列时出现以下错误。

Failed to decrypt a column encryption key using key store provider: 'MSSQL_CERTIFICATE_STORE'. The last 10 bytes of the encrypted column encryption key are: '64-56-87-3B-EC-2E-11-9D-2A-B5'. Certificate with thumbprint 'A0D10777759BBD947EEA6F3F5D1A7989514C45F0' not found in certificate store 'My' in certificate location 'CurrentUser'. Verify the certificate path in the column master key definition in the database is correct, and the certificate has been imported correctly into the certificate location/store. Parameter name: masterKeyPath

最佳答案

这个问题的解决方案是

  1. 运行 (MMC)
  2. 在快照控制台中选择证书。
  3. 找到您始终加密的证书,可以是我的用户,也可以是机器帐户
  4. 右键->所有任务->管理私钥。
  5. 添加正在建立 SQL 连接的 windows 用户。
  6. 用户可以是进程用户,可以是IIS,也可以是任何windows登录用户。

它解决了我的问题。

关于c# - 始终加密 : Failed to decrypt a column encryption key using key store provider: 'MSSQL_CERTIFICATE_STORE' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46975213/

相关文章:

c# - VSTO 中的加载项 - 如何使用带按钮的功能区从 Word 文档中获取文本

wcf - WCF服务监控工具

c# - ASP.NET 自定义配置文件错误

c# - 如何添加 XML 文件并将键值对读入字典?

c# - 查找与搁置集不同的所有文件?

c# - 从数据表中读取值

c# - WCF ServiceHost 似乎为每条消息调用 CustomCertificateValidator

java - jastypt 中的 DES 性能

c# - 将 Delphi 代码翻译成 C# (Blowfish)

c# - 在 C# 服务器和 PHP 客户端中使用 RSA KeyPair