颁发 BACKUP CERTIFICATE 时出错

发布于 2024-09-14 02:29:38 字数 721 浏览 0 评论 0原文

我正在我的一个数据库中创建一个证书,该证书可以正常工作。但是,当我尝试备份该证书以便可以将其移植到另一个数据库时,我收到以下错误消息:

An error occurred during decryption.

这是我的备份语句:

BACKUP CERTIFICATE test_certs TO FILE = 'C:\test_certs.cer'
WITH PRIVATE KEY (FILE = 'C:\test_certs.pvk',
    ENCRYPTION BY PASSWORD = 'SomePassw0rd',
    DECRYPTION BY PASSWORD = 'SomeOtherPassw0rd')

为了安全起见,我已检查服务器是否有 C:\ 驱动器with:

EXEC xp_cmdshell 'DIR C:\'

我还确认我可以使用以下命令写入该位置:

EXEC xp_cmdshell 'echo test > C:\test.txt'

因此,除非 BACKUP CERTIFICATE 使用的安全性与 xp_cmdshell 的安全性不同(这是完全可能的),否则写入磁盘不是问题。

谷歌只找到了一些结果,但似乎都没有解决这个问题。以前有其他人见过这个吗?知道问题是什么吗?

谢谢!

I am creating a certificate in one of my databases, which works without a problem. However, when I try to back up that certificate so that I can port it over to another database I receive the following error message:

An error occurred during decryption.

Here's my backup statement:

BACKUP CERTIFICATE test_certs TO FILE = 'C:\test_certs.cer'
WITH PRIVATE KEY (FILE = 'C:\test_certs.pvk',
    ENCRYPTION BY PASSWORD = 'SomePassw0rd',
    DECRYPTION BY PASSWORD = 'SomeOtherPassw0rd')

Just to be safe, I've checked that the server has a C:\ drive with:

EXEC xp_cmdshell 'DIR C:\'

I also confirmed that I could write to the location with:

EXEC xp_cmdshell 'echo test > C:\test.txt'

So, unless the security used by BACKUP CERTIFICATE is different than that for xp_cmdshell (which is entirely possible), it's not an issue with writing to the disk.

Google turned up only a few results and none of them seemed to address this problem. Has anyone else seen this before? Any idea what the issue is?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

总攻大人 2024-09-21 02:29:38

叹息......显然DECRYPTION BY PASSWORD(但不是ENCRYPTION BY PASSWORD)必须与CREATE的ENCRYPTION BY PASSWORD匹配证书命令。我会把这个留在这里,以防将来其他人也有和我一样的大脑问题。

Sigh... apparently the DECRYPTION BY PASSWORD (but not the ENCRYPTION BY PASSWORD) must match the ENCRYPTION BY PASSWORD of the CREATE CERTIFICATE command. I'll leave this here in case anyone else in the future has the same brain hiccup that I just did.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文