Let's say I have a production server and I have a database master key ##MS_DatabaseMasterKey##
(master_key1) on it. I created a certificate c1
, which is encrypted by master_key1 by default. Then I backed up c1
with the following statement.
BACKUP CERTIFICATE c1 TO FILE = 'c:\c1.crt'
WITH PRIVATE KEY
(
FILE = 'c:\c1_private_key.key',
ENCRYPTION BY PASSWORD = 'c1_private_key_password'
);
After that, I copied the three c1
backup related files to a dev server. On the dev server, I created a new database master key. It's still called ##MS_DatabaseMasterKey##
, but it's a newly created one (let's call it master_key2). Now I restore c1
on the dev server with:
CREATE CERTIFICATE c1
FROM FILE = 'c:\c1.crt'
WITH PRIVATE KEY
(
FILE = 'c:\c1_private_key.key',
DECRYPTION BY PASSWORD = 'c1_private_key_password'
);
Question:
- After I restore
c1
on the dev server, is it encrypted bymaster_key2
? It seems I haven't touchmaster_key2
here. - When I restore
c1
on the dev server, can I change its name to likec2
(CREATE CERTIFICATE c2 ...
)? If I do this, can the TDE encrypted backups on the production server be restored on the dev server?