TDE Certificate backup

  • Hi Guys,

    I am trying to backup a certificate that I created for TDE but I am not successful. Please see my scrip below and also the error message:
    BACKUP CERTIFICATE TDE_Cert
    TO FILE = 'C:\SQL Server\AdventureWorks Certificate'
    WITH PRIVATE KEY (file='C:\SQL Server\AdventureWorks Certificate\TDE_CertKey.pvk',
    ENCRYPTION BY PASSWORD='InsertStrongPasswordHere1')

    and the error is the following:
    Msg 15151, Level 16, State 1, Line 26
    Cannot find the certificate 'TDE_Cert', because it does not exist or you do not have permission.

  • crazy_new - Wednesday, August 16, 2017 3:35 AM

    Hi Guys,

    I am trying to backup a certificate that I created for TDE but I am not successful. Please see my scrip below and also the error message:
    BACKUP CERTIFICATE TDE_Cert
    TO FILE = 'C:\SQL Server\AdventureWorks Certificate'
    WITH PRIVATE KEY (file='C:\SQL Server\AdventureWorks Certificate\TDE_CertKey.pvk',
    ENCRYPTION BY PASSWORD='InsertStrongPasswordHere1')

    and the error is the following:
    Msg 15151, Level 16, State 1, Line 26
    Cannot find the certificate 'TDE_Cert', because it does not exist or you do not have permission.

    Is the location of the certificate correct and what permissions do you have on the server?

    Thanks

  • NorthernSoul - Wednesday, August 16, 2017 3:37 AM

    crazy_new - Wednesday, August 16, 2017 3:35 AM

    Hi Guys,

    I am trying to backup a certificate that I created for TDE but I am not successful. Please see my scrip below and also the error message:
    BACKUP CERTIFICATE TDE_Cert
    TO FILE = 'C:\SQL Server\AdventureWorks Certificate'
    WITH PRIVATE KEY (file='C:\SQL Server\AdventureWorks Certificate\TDE_CertKey.pvk',
    ENCRYPTION BY PASSWORD='InsertStrongPasswordHere1')

    and the error is the following:
    Msg 15151, Level 16, State 1, Line 26
    Cannot find the certificate 'TDE_Cert', because it does not exist or you do not have permission.

    Is the location of the certificate correct and what permissions do you have on the server?

    Thanks

    Sorry, I meant path of the private key.

  • Hi This is on my local, I am just playing around to see how it works. I have now idea where the private key is, that I what I suspecting the issue to be. I ran the followong to create the private key:

    USE AdventureWorks2014
    GO
    CREATE DATABASE ENCRYPTION KEY
    WITH ALGORITHM = AES_256
    ENCRYPTION BY SERVER CERTIFICATE TDE_Cert;
    GO

  • crazy_new - Wednesday, August 16, 2017 3:51 AM

    Hi This is on my local, I am just playing around to see how it works. I have now idea where the private key is, that I what I suspecting the issue to be. I ran the followong to create the private key:

    USE AdventureWorks2014
    GO
    CREATE DATABASE ENCRYPTION KEY
    WITH ALGORITHM = AES_256
    ENCRYPTION BY SERVER CERTIFICATE TDE_Cert;
    GO

    I think you've answered your own question. Find where the private key is.

    Thanks

  • So any idea what the default path might be?

  • crazy_new - Wednesday, August 16, 2017 5:59 AM

    So any idea what the default path might be?

    I believe the default path is the data folder so check in there.

    Thanks

  • That is the first place I tried, but no luck. There is only an AgentSigningCertificate. The strange thing is if I search my localhost for a .pvk (for my private key) and .cer (for my certificate), no data is returned.

  • Is the database instance on your localhost?

  • Are you in master when trying to backup your TDE cert? The cert protecting the DEKs in TDE live in master, this is the only option and by design, so if you are trying to backup the TDE cert I would just double-check that you are in master before trying to run the backup command.

    Joie Andrew
    "Since 1982"

  • Thank you sir, that solved it. I was in the user database, as soon as I switched the to master database I could create the backup.

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply