Skip to main content

Creating A Column Master Key (CMK)

  1. Start the Microsoft SQL Server Management Studio (SSMS) and connect to the desired database to protect.
  2. Create a Column Master Key (CMK) using the Primus HSM or CloudHSM. This key will encrypt all subsequent Column Encryption Keys (CEK).

The examples below are shown with an on-premises Primus HSM.

Within the SSMS, use the Object Explorer and select the Security folder under the desired database (in this example hsmdemodb). Click to expand Always Encrypted Keys. Right click on Column Master Keys and select New Column Master Key….

The New Column Master Key dialogue box will open.

  • Enter a meaningful name for the CMK in the Name field.
  • From the drop-down list select the Key Storage Provider (CNG) option and select the Securosys Primus HSM Key Storage Provider.
  • Click Generate Key to generate a new key pair on the HSM.
  • Click OK to finish the process. On the HSM the key is named by default Always-Encrypted-Auto1, using RSA 2048 bit, not exportable, key usage for decrypt and signing.

Now you have a Column Master Key called HSMDemoCCardCMK, protected by the Primus HSM or CloudsHSM.