The thumbprint of same asymmetric key is not same in 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 and 'SQL Server Connector for Microsoft Azure Key
https://support.microsoft.com/en-us/help/4470999/db-backup-problems-to-sql-server-connector-for-azure-1-0-5-0
A breaking change has been introduced in Version 1.0.5.0 of 'SQL Server Connector for Microsoft Azure Key Vault' . The 1.0.5.0 version updated the way it calculates thumbprints to match the logic used in the engine, in order to support the migration scenario of On Prem SQL Server using EKM to Azure SQL DB using TDE BYOK. Because of this change, customer may hit issues when they are trying to restore database backups from when they were using 1.0.4.0 or old version to a server using 1.0.5.0 version.
Here is an example
===
SQL Server instance sql1 has 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 deployed. SQL Server instance sql2 has 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.5.0 deployed. Both instance sql1 and sql2 deploy an ASYMMETRIC key from the same ASYMMETRIC key in Azure Key Vault.
CREATE ASYMMETRIC KEY TDE_KEY
FROM PROVIDER AzureKeyVaultProvider
WITH PROVIDER_KEY_NAME = 'key1',
CREATION_DISPOSITION = OPEN_EXISTING
The thumbprints are different. The length of thumbprint of 1.0.5.0 version is little bit greater than the thumbprint of 1.0.4.0 version.
Here is example of thumbprint of 1.0.4.0 version
0x2C5677D76F76D77F80
Here is example of thumbprint of 1.0.5.0 version. Please note, both asymmetric keys are created from same source.
0x373B314B78E8D59A0925494558FEF14B726216C5
This breaking change causes problem in backup/restore scenario.
For example, if you have a backup of a database encrypted by an asymmetric key in Azure Key vault in instance sql1.
The instance sql2 has same asymmetric key created.
If you try to restore the backup to instance sql2, the restore fails with the error message below
Msg 33111, Level 16, State 4, Line 20
Cannot find server asymmetric key with thumbprint '0x2C5677D76F76D77F80'.
Here is the query to retrieve the thumbprint of each key.
select thumbprint,* from master.sys.asymmetric_keys
Here is the query to retrieve the thumbprint of each TDE database
select db_name(ddek.database_id) as DatabaseName,ak.name as[Asymmetric key Name], ak.thumbprint From sys.dm_database_encryption_keys ddek inner join master.sys.asymmetric_keys ak on ak.thumbprint=ddek.encryptor_thumbprint
Solution
===
Copy the 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 or related version to the instance sql2 box.
Run the query below in sql2 to change the CRYPTOGRAPHIC PROVIDER to 1.0.4.0 version.
ALTER CRYPTOGRAPHIC PROVIDER AzureKeyVaultProvider
FROM FILE =
'C:\Program Files\SQL Server Connector for Microsoft Azure Key Vault\1.0.4.0\Microsoft.AzureKeyVaultService.EKM.dll'
Create a new asymmetric key using the 1.0.4.0 provider.
CREATE ASYMMETRIC KEY TDE_KEY_1040
FROM PROVIDER AzureKeyVaultProvider
WITH PROVIDER_KEY_NAME = 'key1',
CREATION_DISPOSITION = OPEN_EXISTING
After that, you are able to restore the backup.
Run the query below in sql2 to revert the CRYPTOGRAPHIC PROVIDER to 1.0.5.0 version.
ALTER CRYPTOGRAPHIC PROVIDER AzureKeyVaultProvider
FROM FILE =
'C:\Program Files\SQL Server Connector for Microsoft Azure Key Vault\1.0.5.0\Microsoft.AzureKeyVaultService.EKM.dll'
You can either use the same asymmetric key or change to a new version asymmetric key to use the new thumbprint.
alter DATABASE ENCRYPTION KEY
ENCRYPTION BY SERVER ASYMMETRIC KEY KeyName1050Version
The thumbprint of same asymmetric key is not same in 'SQL Server Connector for Microsoft Azure Key Vault' 1.0.4.0 and 'SQL Server Connector for Microsoft Azure Key的更多相关文章
- SQL语句实现不存在即插入,存在则increase某字段的功能insert into … on duplicate key update
前提条件:必须是唯一主键: CREATE UNIQUE INDEX idx_vote_object ON test_customers_vote (`vote_object`, `vote_objec ...
- yii2.0 报错Cookievalidationkey Must Be Configured With A Secret Key
'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) ...
- OpenSSL和Python实现RSA Key公钥加密私钥解密
基于非对称算法的RSA Key主要有两个用途,数字签名和验证(私钥签名,公钥验证),以及非对称加解密(公钥加密,私钥解密).本文提供一个基于OpenSSL和Python进行非对称加解密的例子. 1. ...
- Redis百亿级Key存储方案(转)
1 需求背景 该应用场景为DMP缓存存储需求,DMP需要管理非常多的第三方id数据,其中包括各媒体cookie与自身cookie(以下统称supperid)的mapping关系,还包括了supperi ...
- 转载文章(Redis中对key的操作)
转载地址:http://www.cnblogs.com/stephen-liu74/archive/2012/03/26/2356951.html 一.概述: 在该系列的前几篇博客中,主要讲述的是与R ...
- Duplicate entry 'javajavajav' for key 'username'
org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: com.mysql.jd ...
- 关于MapReduce中自定义带比较key类、比较器类(二)——初学者从源码查看其原理
Job类 /** * Define the comparator that controls * how the keys are sorted before they * are pa ...
- android初级篇之apk签名key keystore格式转pk8+x509.pem
转自:http://www.jianshu.com/p/3bd5c68cc44d 常用的android的签名工具有两个即jarsigner 和apksigner.这两种使用的key格式不一样,keys ...
- 深入理解ConcurrentMap.putIfAbsent(key,value) 用法
转自:http://blog.csdn.net/exceptional_derek/article/details/40384659 先看一段代码: public class Locale { pri ...
随机推荐
- SET ANSI_WARNINGS { ON | OFF }
SET ANSI_WARNINGS { ON | OFF } 注释 SET ANSI_WARNINGS 影响以下情况: 当设置为 ON 时,如果聚合函数(如 SUM.AVG.MAX.MIN.STDEV ...
- iOS12系统应用发送普通邮件构建邮件
iOS12系统应用发送普通邮件构建邮件 当确定设备支持邮件发送功能后,开发者就可以实现该功能.根据是否包含附件,邮件可以分为普通邮件和附件邮件两种.本节首先讲解如何发送普通邮件.实现过程如下: 1.构 ...
- Xamarin SQLite教程数据库访问与生成
Xamarin SQLite教程数据库访问与生成 在本教程中,我们将讲解如何开发SQLite相关的App.在编写程序前,首先需要做一些准备工作,如了解Xamarin数据库访问方式,添加引用,构建使用库 ...
- Python3基础系列-程序模板及代码本质
概要 横看成岭侧成峰,远近高低各不同.但是,程序的设计核心思想却是很简单,简单理解就是有一个输入,对输入的处理环节,最后得出一个输出.这个过程中的设计及其实现却是各不相同.本节的主要内容如下: 程序设 ...
- java发送邮件高级篇
package com.xiets.javamaildemo; import java.util.Date; import java.util.Properties; import javax.act ...
- HTTP断点续传
一.概述 所谓断点续传,其实只是指下载,也就是要从文件已经下载的地方开始继续下载.在以前版本的HTTP协议是不支持断点的,HTTP/1.1开始就支持了.一般断点下载时才用到Range和Conten ...
- CSS之优先级
css的优先级 所谓CSS优先级,即是指CSS样式在浏览器中被解析的先后顺序. 样式表中的特殊性描述了不同规则的相对权重,它的基本规则是: 1 内联样式表的权值最高 sty ...
- pygame-KidsCanCode系列jumpy-part9-使用spritesheet
做过前端的兄弟应该都知道css sprite(也称css精灵),这是一种常用的减少http请求次数的优化手段.把很多小图拼成一张大图,只加载1次,然后用css定位到不区的区域,从而展示不同的图片.游戏 ...
- 咏南APP(手机)开发框架
咏南APP(手机)开发框架 有意者可向咏南索取DEMO. 基于DELPHI官方的FIREMONKEY类库构建,不使用任何三方控件. 原生手机框架,支持各种手机硬件操作. 主界面 聊天 照相并分享 短信 ...
- 修复恢复"可疑"的SQLServer数据库
今天机房突然断电,DB连不上了,提示 无法打开数据库'MyDB'.恢复操作已将该数据库标记为 SUSPECT. 原因是断电导致DB文件损坏 通过SQL Server Management Studio ...