New-SqlCngColumnMasterKeySettings
建立 SqlColumnMasterKeySettings 物件,描述儲存在支援 CNG API 之金鑰存放區中的非對稱金鑰。
Syntax
New-SqlCngColumnMasterKeySettings
[-CngProviderName] <String>
[-KeyName] <String>
[<CommonParameters>]
Description
New-SqlCngColumnMasterKeySettings Cmdlet 會建立SqlColumnMasterKeySettings物件。 SqlColumnMasterKeySettings物件會參考金鑰,儲存在支援密碼編譯新一代 (CNG) API 的金鑰存放區中。 SqlColumnMasterKeySettings物件有兩個屬性:KeyStoreProviderName和KeyPath。 此 Cmdlet 會將 KeyStoreProviderName 屬性設定為包含 CNG 之資料行主要金鑰存放區提供者的名稱,然後產生並設定 KeyPath 屬性的值來參考指定的金鑰。
範例
範例 1:建立 SqlColumnMasterKeySettings 物件
PS C:\> $CMKSettings = New-SqlCngColumnMasterKeySettings -CngProviderName "Microsoft Software Key Storage Provider" -KeyName "AlwaysEncryptedKey"
此命令會建立 SqlColumnMasterKeySettings 物件,參考由名為 Microsoft Software Key Storage Provider 的 CNG 提供者所封裝之金鑰存放區中的金鑰。 命令接著會將作業的結果儲存在名為 $CMKSettings的變數中。
參數
-CngProviderName
指定金鑰存放區的 CNG 提供者名稱。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-KeyName
指定金鑰存放區中的金鑰名稱。
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸出
SqlColumnMasterKeySettings