共用方式為


New-SqlCngColumnMasterKeySettings

建立 SqlColumnMasterKeySettings 物件,描述支援 CNG API 之密鑰存放區中儲存的非對稱密鑰。

語法

New-SqlCngColumnMasterKeySettings
   [-CngProviderName] <String>
   [-KeyName] <String>
   [-ProgressAction <ActionPreference>]
   [<CommonParameters>]

Description

New-SqlCngColumnMasterKeySettings Cmdlet 會建立 SqlColumnMasterKeySettings 物件。 SqlColumnMasterKeySettings 物件會參考金鑰,該金鑰儲存在支援新一代密碼編譯 (CNG) API 的密鑰存放區中。 SqlColumnMasterKeySettings 物件有兩個屬性:KeyStoreProviderNameKeyPath。 此 Cmdlet 會將 KeyStoreProviderName 屬性設定為包含 CNG 資料行主要金鑰存放區提供者的名稱,然後產生並設定 KeyPath 屬性的值,以參考指定的索引鍵。

範例

範例 1:建立 SqlColumnMasterKeySettings 物件

PS C:\> $CMKSettings = New-SqlCngColumnMasterKeySettings -CngProviderName "Microsoft Software Key Storage Provider" -KeyName "AlwaysEncryptedKey"

此命令會建立 SqlColumnMasterKeySettings 對象,參考由名為 Microsoft 軟體密鑰儲存提供者的 CNG 提供者所封裝之密鑰存放區中的金鑰。 命令接著會將作業的結果儲存在名為 $CMKSettings的變數中。

參數

-CngProviderName

指定金鑰存放區的 CNG 提供者名稱。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-KeyName

指定金鑰存放區中的金鑰名稱。

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ProgressAction

決定 PowerShell 如何回應腳本、Cmdlet 或提供者所產生的進度更新,例如 Write-Progress Cmdlet 所產生的進度列。 Write-Progress Cmdlet 會建立顯示命令狀態的進度列。

類型:ActionPreference
別名:proga
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸出

SqlColumnMasterKeySettings