I am facing an error while restoring the certificate for TDE encryption in SQL server 2008 R2. I am using the same certificate which is configured for SSL. Following are the steps which i have taken :
- First of all convert the .crt file to .cer.
After that i converted the private key (.key) file to .pvk using openSSL command:
openssl rsa -in private.key –outform PVK –pvk-strong -out private.pvk
Now i am trying to create the certificate by using the following Query:
CREATE CERTIFICATE TDE_Cert1 FROM FILE = [Path to .cer file]' WITH PRIVATE KEY (FILE=[Path to .pvk file],DECRYPTION BY PASSWORD = [Password used to encrypt .pvk file])
But i am getting following error:
Msg 15208, Level 16, State 1, Line 1 The certificate, asymmetric key, or private key file does not exist or has invalid format.
Please suggest , if i am doing anything wrong in the above process.