共用方式為


New-SqlCspColumnMasterKeySettings

建立 SqlColumnMasterKeySettings 物件,描述使用 CSP 支援 CAPI 儲存在密鑰存放區中的非對稱密鑰。

語法

Default (預設值)

New-SqlCspColumnMasterKeySettings
    [-CspProviderName] <String>
    [-KeyName] <String>
    [<CommonParameters>]

Description

New-SqlCspColumnMasterKeySettings Cmdlet 會建立 SqlColumnMasterKeySettings 物件。 SqlColumnMasterKeySettings 物件會參考密鑰,該金鑰存放區使用支援Microsoft密碼編譯 API (CAPI) 的密碼編譯服務提供者 (CSP) 儲存在密鑰存放區中。 SqlColumnMasterKeySettings 物件有兩個屬性:KeyStoreProviderNameKeyPath。 此 Cmdlet 會將 KeyStoreProviderName 屬性設定為包含使用 CSP/CAPI 的數據行主要金鑰存放區提供者名稱,然後產生並設定 KeyPath 屬性的值來參考指定的密鑰。

範例

範例 1:建立 SqlColumnMasterKeySettings 物件

PS C:\> $CmkSettings = New-SqlCspColumnMasterKeySettings -CspProviderName "Microsoft Software Key Storage Provider" -KeyName "AlwaysEncryptedKey"

此命令會建立 SqlColumnMasterKeySettings 對象,參考 CSP 提供者所封裝的密鑰存放區中的金鑰,稱為Microsoft軟體密鑰儲存提供者。

參數

-CspProviderName

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

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:0
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-KeyName

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

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:1
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

CommonParameters

此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters

輸出

SqlColumnMasterKeySettings