New-SqlCngColumnMasterKeySettings
创建一个 SqlColumnMasterKeySettings 对象,该对象描述支持 CNG API 的密钥存储中存储的非对称密钥。
语法
New-SqlCngColumnMasterKeySettings
[-CngProviderName] <String>
[-KeyName] <String>
[<CommonParameters>]
说明
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