共用方式為


KeyVaultClient.ImportCertificateWithHttpMessagesAsync Method

Definition

Imports a certificate into a specified key vault.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.KeyVault.Models.CertificateBundle>> ImportCertificateWithHttpMessagesAsync (string vaultBaseUrl, string certificateName, string base64EncodedCertificate, string password = default, Microsoft.Azure.KeyVault.Models.CertificatePolicy certificatePolicy = default, Microsoft.Azure.KeyVault.Models.CertificateAttributes certificateAttributes = 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 ImportCertificateWithHttpMessagesAsync : string * string * string * string * Microsoft.Azure.KeyVault.Models.CertificatePolicy * Microsoft.Azure.KeyVault.Models.CertificateAttributes * 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.CertificateBundle>>
override this.ImportCertificateWithHttpMessagesAsync : string * string * string * string * Microsoft.Azure.KeyVault.Models.CertificatePolicy * Microsoft.Azure.KeyVault.Models.CertificateAttributes * 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.CertificateBundle>>
Public Function ImportCertificateWithHttpMessagesAsync (vaultBaseUrl As String, certificateName As String, base64EncodedCertificate As String, Optional password As String = Nothing, Optional certificatePolicy As CertificatePolicy = Nothing, Optional certificateAttributes As CertificateAttributes = 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 CertificateBundle))

Parameters

vaultBaseUrl
String

The vault name, for example https://myvault.vault.azure.net.

certificateName
String

The name of the certificate.

base64EncodedCertificate
String

Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key.

password
String

If the private key in base64EncodedCertificate is encrypted, the password used for encryption.

certificatePolicy
CertificatePolicy

The management policy for the certificate.

certificateAttributes
CertificateAttributes

The attributes of the certificate (optional).

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

Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission.

Applies to