17.07.2015 Views

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

Download eBook (PDF) - Red Gate Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 – Transparent Data EncryptionNotice that, while ENCRYPTED BY PASSWORD is a required argument to themethod, our intent, as in Chapter 5, is to instead protect the database masterkey with the service master key. This option is automatically available to us,upon creation of the database master key.A search against the sys.key_encryptions catalog view for the##MS_DatabaseMasterKey## key, as shown in Listing 6-3, returnsENCRYPTION BY MASTER KEY, in reference to the service master key.USE master;GOSELECTb.name,a.crypt_type_descFROMsys.key_encryptions aINNER JOIN sys.symmetric_keys bON a.key_id = b.symmetric_key_idWHEREb.name = '##MS_DatabaseMasterKey##';GOListing 6-3: Confirming protection of the database master key by the service masterkey.The next step is to create a self-signed certificate that is protected by thedatabase master key of our Master database. All certificates created withinSQL Server, as opposed to being imported, are self-signed. This associates thecertificate to the database.Certificates are created using the CREATE CERTIFICATE method, asdescribed in the previous chapter in Listing 5-5. Since this certificate is locatedin the Master database and will be used to protect the database encryptionkey of our HomeLending database, we will name this certificateMasterCert, as shown in Listing 6-4.USE master;GOCREATE CERTIFICATE MasterCertWITH SUBJECT = 'Cert used for TDE';GOListing 6-4: Creating the MasterCert self-signed .135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!