The New-SqlColumnMasterKeySettings cmdlet creates a SqlColumnMasterKeySettings in-memory object that stores properties
of a column master key for Always Encrypted: KeyStoreProviderName, KeyPath, AllowEnclaveComputations, and Signature. This
cmdlet can be used for custom key store providers and when both the key store provider name and a fully-formatted key path
are known.
The cmdlet may communicate with a key store holding the column master key to generate a signature of key metadata properties.
If the key is stored in Azure, you need to specify a valid authentication token for a key vault or a managed HSM holding the key.
Alternatively, you can authenticate to Azure with Add-SqlAzureAuthenticationContext before calling this cmdlet.
Module requirements: version 21+ on PowerShell 5.1; version 22+ on PowerShell 7.x.
Примеры
Example 1: Generate settings for a column master key that is in Azure Key Vault and is not enclaved-enabled.
Example 3: Generate settings for a column master key that is in Azure Key Vault, allows enclave computations and is signed using the provided signature.
Example 4: Generate settings for a column master key that is in Azure Key Vault, allows enclave computations and is auto-signed.
# Connect to Azure account.
Import-Module Az.Accounts -MinimumVersion 2.2.0
Connect-AzAccount
# Obtain an access token for key vaults.
$keyVaultAccessToken = (Get-AzAccessToken -ResourceUrl https://vault.azure.net).Token
# Pass the token to the cmdlet. It will use the token to communicate with a key vault in Azure Key Vault to sign the column master key properties.
$cmkSettings = New-SqlColumnMasterKeySettings -KeyStoreProviderName 'AZURE_KEY_VAULT' -KeyPath 'https://myvault.vault.azure.net/keys/CMK/4c05f1a41b12488f9cba2ea964b6a700' -AllowEnclaveComputations -KeyVaultAccessToken $keyVaultAccessToken
Параметры
-AllowEnclaveComputations
Specifies whether the column master key allows enclave computations. If the parameter is specified, server-side secure enclaves will
be allowed to perform computations on data protected with the column master key. Not valid for SQL Server 2017 and older versions.
Свойства параметра
Тип:
SwitchParameter
Default value:
False
Поддерживаются подстановочные знаки:
False
DontShow:
False
Наборы параметров
(All)
Position:
2
Обязательно:
False
Значение из конвейера:
False
Значение из конвейера по имени свойства:
False
Значение из оставшихся аргументов:
False
-KeyPath
Specifies the path within the key store of the physical master key.
Свойства параметра
Тип:
String
Default value:
None
Поддерживаются подстановочные знаки:
False
DontShow:
False
Наборы параметров
(All)
Position:
1
Обязательно:
True
Значение из конвейера:
False
Значение из конвейера по имени свойства:
False
Значение из оставшихся аргументов:
False
-KeyStoreProviderName
Specifies the provider name of the key store used to protect the physical master key.
Свойства параметра
Тип:
String
Default value:
None
Поддерживаются подстановочные знаки:
False
DontShow:
False
Наборы параметров
(All)
Position:
0
Обязательно:
True
Значение из конвейера:
False
Значение из конвейера по имени свойства:
False
Значение из оставшихся аргументов:
False
-KeyVaultAccessToken
Specifies an access token for key vaults in Azure Key Vault. Use this parameter if the specified column
master key is stored in a key vault in Azure Key Vault and the cmdlet is expected to sign key metadata.
Свойства параметра
Тип:
String
Default value:
None
Поддерживаются подстановочные знаки:
False
DontShow:
False
Наборы параметров
(All)
Position:
Named
Обязательно:
False
Значение из конвейера:
False
Значение из конвейера по имени свойства:
False
Значение из оставшихся аргументов:
False
-ManagedHsmAccessToken
Specifies an access token for managed HSMs in Azure Key Vault. Use this parameter if the specified column
master key is stored in a managed HSM in Azure Key Vault and the cmdlet is expected to sign key metadata.
Свойства параметра
Тип:
String
Default value:
None
Поддерживаются подстановочные знаки:
False
DontShow:
False
Наборы параметров
(All)
Position:
Named
Обязательно:
False
Значение из конвейера:
False
Значение из конвейера по имени свойства:
False
Значение из оставшихся аргументов:
False
-Signature
Specifies a hexadecimal string that is a digital signature of column master key properties. A client driver can verify the
signature to ensure the column master key properties have not been tampered with. This parameter is allowed only if AllowEnclaveComputations
is specified. If AllowEnclaveComputations is specified, but Signature is not, the cmdlet automatically computes the signature and
populates the Signature property of the new SqlColumnMasterKeySettings object.
Свойства параметра
Тип:
String
Default value:
None
Поддерживаются подстановочные знаки:
False
DontShow:
False
Наборы параметров
(All)
Position:
3
Обязательно:
False
Значение из конвейера:
False
Значение из конвейера по имени свойства:
False
Значение из оставшихся аргументов:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.