颁发 BACKUP CERTIFICATE 时出错
我正在我的一个数据库中创建一个证书,该证书可以正常工作。但是,当我尝试备份该证书以便可以将其移植到另一个数据库时,我收到以下错误消息:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
叹息......显然
DECRYPTION BY PASSWORD
(但不是ENCRYPTION BY PASSWORD
)必须与CREATE的
ENCRYPTION BY PASSWORD
匹配证书命令。我会把这个留在这里,以防将来其他人也有和我一样的大脑问题。Sigh... apparently the
DECRYPTION BY PASSWORD
(but not theENCRYPTION BY PASSWORD
) must match theENCRYPTION BY PASSWORD
of theCREATE CERTIFICATE
command. I'll leave this here in case anyone else in the future has the same brain hiccup that I just did.