How to backup asymmetric key in SQL 2005

  • How to backup asymmetric key in SQL 2005 created in the following way so it can be copied to another server ? Also can you copy it to the other server after backing it up.

    CREATE ASYMMETRIC KEY ccnumber WITH ALGORITHM = RSA_512

    ENCRYPTION BY PASSWORD = 'password';

  • Based on my understanding, only service and database master keys can be backed up. Other keys are protected by master keys. Check BOL for Encryption Hierarchy

  • A Microsoft rep swore they could do this, but I am yet to find a way to either restore or recreate an assymmetric key.  If you lose it, any data encrypted with that key is gone.  Even creating a new key with the same parameters does no good, since any encrypted data checks the KEYGUID of any decryption key to see if it matches the KEYGUID of the key with which it was originally encrypted.   One can't manually set the KEYGUID in the sys.symmetric_keys view because adhoc updates are not supported.

    Has anyone successfully restored a deleted key (without restoring the database) and recovered encrypted data?

  • The asymmetric keys are stored in sys.asymmetric_keys, just restore from there.

Viewing 4 posts - 1 through 3 (of 3 total)

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