- Create a Certificate in the Database where the Assembly resides
- Back up the Certificate (both Public and Private Keys) to files (optional)
- Sign the Assembly (or Assemblies) with the Certificate
- Remove the Private Key (it can be restored later from the backup file) (optional)
- For each additional Database that has unsigned,
SAFE
Assemblies: - Either skip this sub-step (i.e. skip to Step 6), complete the steps, and repeat the whole process (this will result in one Certificate per each Database needing one), OR
- Do the following (this will result in one Certificate total, which will be used for all Databases):
- Create the same Certificate from the backup files (including the Private Key!)
- Sign the Assembly (or Assemblies) with the Certificate
- Remove the Private Key (it can be restored later from the backup file)
- Copy Certificate to
[master]
(Public Key only!) - Create Login from Certificate
- Grant the Certificate-based Login the
UNSAFE ASSEMBLY
permission
A simple example of this (minus the optional backup and Private Key removal) would be: