New-SqlCngColumnMasterKeySettings
创建一个 SqlColumnMasterKeySettings 对象,该对象描述存储在支持 CNG API 的密钥存储中的非对称密钥。
语法
Default (默认值)
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软件密钥存储提供程序的 CNG 提供程序封装的密钥存储中的密钥。 然后,该命令将作的结果存储在名为 $CMKSettings的变量中。
参数
-CngProviderName
指定密钥存储的 CNG 提供程序的名称。
参数属性
| 类型: | 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。