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软件密钥存储提供程序的 CNG 提供程序封装的密钥存储中的密钥。 然后,该命令将作的结果存储在名为 $CMKSettings的变量中。
参数
-CngProviderName
指定密钥存储的 CNG 提供程序的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-KeyName
指定密钥存储区中的密钥的名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
输出
SqlColumnMasterKeySettings