com.azure.security.keyvault.certificates

Definition

Package containing classes for creating CertificateAsyncClient and CertificateClient to perform operations on Azure Key Vault.

Classes

CertificateAsyncClient

The CertificateAsyncClient provides asynchronous methods to manage KeyVaultCertificate in the Azure Key Vault. The client supports creating, retrieving, updating, merging, deleting, purging, backing up, restoring and listing the KeyVaultCertificate. The client also supports listing DeletedCertificate for a soft-delete enabled Azure Key Vault.

The client further allows creating, retrieving, updating, deleting and listing the CertificateIssuer. The client also supports creating, listing and deleting CertificateContact

Samples to construct the async client

CertificateAsyncClient certificateAsyncClient = new CertificateClientBuilder()
     .credential(new DefaultAzureCredentialBuilder().build())
     .vaultUrl("https://myvault.vault.azure.net/")
     .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))
     .buildAsyncClient();
CertificateClient

The CertificateClient provides synchronous methods to manage KeyVaultCertificate in the Azure Key Vault. The client supports creating, retrieving, updating, merging, deleting, purging, backing up, restoring and listing the KeyVaultCertificate. The client also supports listing DeletedCertificate for a soft-delete enabled Azure Key Vault.

The client further allows creating, retrieving, updating, deleting and listing the CertificateIssuer. The client also supports creating, listing and deleting CertificateContact

Samples to construct the sync client

CertificateClient certificateClient = new CertificateClientBuilder()
     .credential(new DefaultAzureCredentialBuilder().build())
     .vaultUrl("https://myvault.vault.azure.net/")
     .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))
     .buildClient();
CertificateClientBuilder

This class provides a fluent builder API to help aid the configuration and instantiation of the CertificateAsyncClient and CertificateClient, by calling buildAsyncClient() and buildClient() respectively It constructs an instance of the desired client.

The minimal configuration options required by CertificateClientBuilder to build CertificateAsyncClient are vaultUrl and TokenCredential.

CertificateAsyncClient certificateAsyncClient = new CertificateClientBuilder()
     .credential(new DefaultAzureCredentialBuilder().build())
     .vaultUrl("https://myvault.vault.azure.net/")
     .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))
     .buildAsyncClient();

The log detail level, multiple custom policies and custom HttpClient can be optionally configured in the CertificateClientBuilder.

CertificateAsyncClient certificateAsyncClient = new CertificateClientBuilder()
     .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))
     .vaultUrl("https://myvault.azure.net/")
     .credential(new DefaultAzureCredentialBuilder().build())
     .httpClient(HttpClient.createDefault())
     .buildAsyncClient();

Alternatively, custom HttpPipeline with custom HttpPipelinePolicy policies and vaultUrl can be specified. It provides finer control over the construction of CertificateAsyncClient and CertificateClient

HttpPipeline pipeline = new HttpPipelineBuilder()
     .policies(new KeyVaultCredentialPolicy(new DefaultAzureCredentialBuilder().build()), new RetryPolicy())
     .build();
 CertificateAsyncClient certificateAsyncClient = new CertificateClientBuilder()
     .pipeline(pipeline)
     .vaultUrl("https://myvault.azure.net/")
     .buildAsyncClient();

The minimal configuration options required by CertificateClientBuilder to build CertificateClient are vaultUrl and TokenCredential.

CertificateClient certificateClient = new CertificateClientBuilder()
     .credential(new DefaultAzureCredentialBuilder().build())
     .vaultUrl("https://myvault.vault.azure.net/")
     .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))
     .buildClient();

Enums

CertificateServiceVersion

The versions of Azure Key Vault Certificate supported by this client library.