KeyVaultClient.ImportKeyWithHttpMessagesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.KeyBundle>> ImportKeyWithHttpMessagesAsync (string vaultBaseUrl, string keyName, Microsoft.Azure.KeyVault.WebKey.JsonWebKey key, bool? hsm = default, Microsoft.Azure.KeyVault.Models.KeyAttributes keyAttributes = default, System.Collections.Generic.IDictionary<string,string> tags = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ImportKeyWithHttpMessagesAsync : string * string * Microsoft.Azure.KeyVault.WebKey.JsonWebKey * Nullable<bool> * Microsoft.Azure.KeyVault.Models.KeyAttributes * System.Collections.Generic.IDictionary<string, string> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.KeyBundle>>
override this.ImportKeyWithHttpMessagesAsync : string * string * Microsoft.Azure.KeyVault.WebKey.JsonWebKey * Nullable<bool> * Microsoft.Azure.KeyVault.Models.KeyAttributes * System.Collections.Generic.IDictionary<string, string> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.KeyBundle>>
Public Function ImportKeyWithHttpMessagesAsync (vaultBaseUrl As String, keyName As String, key As JsonWebKey, Optional hsm As Nullable(Of Boolean) = Nothing, Optional keyAttributes As KeyAttributes = Nothing, Optional tags As IDictionary(Of String, String) = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse(Of KeyBundle))
Parameters
- vaultBaseUrl
- String
The vault name, for example https://myvault.vault.azure.net.
- keyName
- String
Name for the imported key.
- key
- JsonWebKey
The Json web key
- keyAttributes
- KeyAttributes
The key management attributes.
- tags
- IDictionary<String,String>
Application specific metadata in the form of key-value pairs.
- customHeaders
- Dictionary<String,List<String>>
Headers that will be added to request.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
Implements
Exceptions
Thrown when the operation returned an invalid status code
Thrown when unable to deserialize the response
Thrown when a required parameter is null
Thrown when a required parameter is null
Remarks
The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission.