public final class CertificateAsyncClient extends Object
certifcates in the Azure Key Vault. The client
supports creating, retrieving, updating, merging, deleting, purging, backing up, restoring and listing the
certificates. The client also supports listing deleted certificates for
a soft-delete enabled Azure Key Vault.
The client further allows creating, retrieving, updating, deleting and listing the certificate issuers. The client also supports
creating, listing and deleting certificate contacts
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();
CertificateClientBuilder,
PagedFlux| Modifier and Type | Method and Description |
|---|---|
Mono<byte[]> |
backupCertificate(String certificateName)
Requests that a backup of the specified certificate be downloaded to the client.
|
Mono<com.azure.core.http.rest.Response<byte[]>> |
backupCertificateWithResponse(String certificateName)
Requests that a backup of the specified certificate be downloaded to the client.
|
com.azure.core.util.polling.PollerFlux<CertificateOperation,KeyVaultCertificateWithPolicy> |
beginCreateCertificate(String certificateName,
CertificatePolicy policy)
Creates a new certificate.
|
com.azure.core.util.polling.PollerFlux<CertificateOperation,KeyVaultCertificateWithPolicy> |
beginCreateCertificate(String certificateName,
CertificatePolicy policy,
Boolean isEnabled,
Map<String,String> tags)
Creates a new certificate.
|
com.azure.core.util.polling.PollerFlux<DeletedCertificate,Void> |
beginDeleteCertificate(String certificateName)
Deletes a certificate from a specified key vault.
|
com.azure.core.util.polling.PollerFlux<KeyVaultCertificateWithPolicy,Void> |
beginRecoverDeletedCertificate(String certificateName)
Recovers the deleted certificate back to its current version under /certificates and can only be performed on a soft-delete enabled vault.
|
Mono<CertificateOperation> |
cancelCertificateOperation(String certificateName)
Cancels a certificate creation operation that is already in progress.
|
Mono<com.azure.core.http.rest.Response<CertificateOperation>> |
cancelCertificateOperationWithResponse(String certificateName)
Cancels a certificate creation operation that is already in progress.
|
Mono<CertificateIssuer> |
createIssuer(CertificateIssuer issuer)
Creates the specified certificate issuer.
|
Mono<com.azure.core.http.rest.Response<CertificateIssuer>> |
createIssuerWithResponse(CertificateIssuer issuer)
Creates the specified certificate issuer.
|
Mono<CertificateOperation> |
deleteCertificateOperation(String certificateName)
Deletes the creation operation for the specified certificate that is in the process of being created.
|
Mono<com.azure.core.http.rest.Response<CertificateOperation>> |
deleteCertificateOperationWithResponse(String certificateName)
Deletes the creation operation for the specified certificate that is in the process of being created.
|
com.azure.core.http.rest.PagedFlux<CertificateContact> |
deleteContacts()
Deletes the certificate contacts in the key vault.
|
Mono<CertificateIssuer> |
deleteIssuer(String issuerName)
Deletes the specified certificate issuer.
|
Mono<com.azure.core.http.rest.Response<CertificateIssuer>> |
deleteIssuerWithResponse(String issuerName)
Deletes the specified certificate issuer.
|
Mono<KeyVaultCertificateWithPolicy> |
getCertificate(String certificateName)
Gets information about the latest version of the specified certificate.
|
com.azure.core.util.polling.PollerFlux<CertificateOperation,KeyVaultCertificateWithPolicy> |
getCertificateOperation(String certificateName)
Gets a pending
CertificateOperation from the key vault. |
Mono<CertificatePolicy> |
getCertificatePolicy(String certificateName)
Retrieves the policy of the specified certificate in the key vault.
|
Mono<com.azure.core.http.rest.Response<CertificatePolicy>> |
getCertificatePolicyWithResponse(String certificateName)
Retrieves the policy of the specified certificate in the key vault.
|
Mono<KeyVaultCertificate> |
getCertificateVersion(String certificateName,
String version)
Gets information about the specified version of the specified certificate.
|
Mono<com.azure.core.http.rest.Response<KeyVaultCertificate>> |
getCertificateVersionWithResponse(String certificateName,
String version)
Gets information about the latest version of the specified certificate.
|
Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> |
getCertificateWithResponse(String certificateName)
Gets information about the latest version of the specified certificate.
|
Mono<DeletedCertificate> |
getDeletedCertificate(String certificateName)
Retrieves information about the specified deleted certificate.
|
Mono<com.azure.core.http.rest.Response<DeletedCertificate>> |
getDeletedCertificateWithResponse(String certificateName)
Retrieves information about the specified deleted certificate.
|
Mono<CertificateIssuer> |
getIssuer(String issuerName)
Retrieves the specified certificate issuer from the key vault.
|
Mono<com.azure.core.http.rest.Response<CertificateIssuer>> |
getIssuerWithResponse(String issuerName)
Retrieves the specified certificate issuer from the key vault.
|
String |
getVaultUrl()
Get the vault endpoint url to which service requests are sent to.
|
Mono<KeyVaultCertificateWithPolicy> |
importCertificate(ImportCertificateOptions importCertificateOptions)
Imports a pre-existing certificate to the key vault.
|
Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> |
importCertificateWithResponse(ImportCertificateOptions importCertificateOptions)
Imports a pre-existing certificate to the key vault.
|
com.azure.core.http.rest.PagedFlux<CertificateContact> |
listContacts()
Lists the certificate contacts in the key vault.
|
com.azure.core.http.rest.PagedFlux<DeletedCertificate> |
listDeletedCertificates()
Lists the
deleted certificates in the key vault currently available for recovery. |
com.azure.core.http.rest.PagedFlux<DeletedCertificate> |
listDeletedCertificates(boolean includePending)
Lists the
deleted certificates in the key vault currently available for recovery. |
com.azure.core.http.rest.PagedFlux<CertificateProperties> |
listPropertiesOfCertificates()
List certificates in a the key vault.
|
com.azure.core.http.rest.PagedFlux<CertificateProperties> |
listPropertiesOfCertificates(boolean includePending)
List certificates in a the key vault.
|
com.azure.core.http.rest.PagedFlux<CertificateProperties> |
listPropertiesOfCertificateVersions(String certificateName)
List all versions of the specified certificate.
|
com.azure.core.http.rest.PagedFlux<IssuerProperties> |
listPropertiesOfIssuers()
List all the certificate issuers resources in the key vault.
|
Mono<KeyVaultCertificate> |
mergeCertificate(MergeCertificateOptions mergeCertificateOptions)
Merges a certificate or a certificate chain with a key pair currently available in the service.
|
Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> |
mergeCertificateWithResponse(MergeCertificateOptions mergeCertificateOptions)
Merges a certificate or a certificate chain with a key pair currently available in the service.
|
Mono<Void> |
purgeDeletedCertificate(String certificateName)
Permanently deletes the specified deleted certificate without possibility for recovery.
|
Mono<com.azure.core.http.rest.Response<Void>> |
purgeDeletedCertificateWithResponse(String certificateName)
Permanently deletes the specified deleted certificate without possibility for recovery.
|
Mono<KeyVaultCertificateWithPolicy> |
restoreCertificateBackup(byte[] backup)
Restores a backed up certificate to the vault.
|
Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> |
restoreCertificateBackupWithResponse(byte[] backup)
Restores a backed up certificate to the vault.
|
com.azure.core.http.rest.PagedFlux<CertificateContact> |
setContacts(List<CertificateContact> contacts)
Sets the certificate contacts on the key vault.
|
Mono<CertificatePolicy> |
updateCertificatePolicy(String certificateName,
CertificatePolicy policy)
Updates the policy for a certificate.
|
Mono<com.azure.core.http.rest.Response<CertificatePolicy>> |
updateCertificatePolicyWithResponse(String certificateName,
CertificatePolicy policy)
Updates the policy for a certificate.
|
Mono<KeyVaultCertificate> |
updateCertificateProperties(CertificateProperties properties)
Updates the specified attributes associated with the specified certificate.
|
Mono<com.azure.core.http.rest.Response<KeyVaultCertificate>> |
updateCertificatePropertiesWithResponse(CertificateProperties properties)
Updates the specified attributes associated with the specified certificate.
|
Mono<CertificateIssuer> |
updateIssuer(CertificateIssuer issuer)
Updates the specified certificate issuer.
|
Mono<com.azure.core.http.rest.Response<CertificateIssuer>> |
updateIssuerWithResponse(CertificateIssuer issuer)
Updates the specified certificate issuer.
|
public String getVaultUrl()
public com.azure.core.util.polling.PollerFlux<CertificateOperation,KeyVaultCertificateWithPolicy> beginCreateCertificate(String certificateName, CertificatePolicy policy, Boolean isEnabled, Map<String,String> tags)
Code Samples
Create certificate is a long running operation. The poller allows users to automatically poll on the create certificate
operation status. It is possible to monitor each intermediate poll response during the poll operation.
CertificatePolicy policy = new CertificatePolicy("Self", "CN=SelfSignedJavaPkcs12");
Map<String, String> tags = new HashMap<>();
tags.put("foo", "bar");
certificateAsyncClient.beginCreateCertificate("certificateName", policy, true, tags)
.subscribe(pollResponse -> {
System.out.println("---------------------------------------------------------------------------------");
System.out.println(pollResponse.getStatus());
System.out.println(pollResponse.getValue().getStatus());
System.out.println(pollResponse.getValue().getStatusDetails());
});
certificateName - The name of the certificate to be created.policy - The policy of the certificate to be created.isEnabled - The enabled status for the certificate.tags - The application specific metadata to set.PollerFlux polling on the create certificate operation status.com.azure.core.exception.ResourceModifiedException - when invalid certificate policy configuration is provided.public com.azure.core.util.polling.PollerFlux<CertificateOperation,KeyVaultCertificateWithPolicy> beginCreateCertificate(String certificateName, CertificatePolicy policy)
Code Samples
Create certificate is a long running operation. The poller allows users to automatically poll on the create certificate
operation status. It is possible to monitor each intermediate poll response during the poll operation.
CertificatePolicy certPolicy = new CertificatePolicy("Self", "CN=SelfSignedJavaPkcs12");
certificateAsyncClient.beginCreateCertificate("certificateName", certPolicy)
.subscribe(pollResponse -> {
System.out.println("---------------------------------------------------------------------------------");
System.out.println(pollResponse.getStatus());
System.out.println(pollResponse.getValue().getStatus());
System.out.println(pollResponse.getValue().getStatusDetails());
});
certificateName - The name of the certificate to be created.policy - The policy of the certificate to be created.PollerFlux polling on the create certificate operation status.com.azure.core.exception.ResourceModifiedException - when invalid certificate policy configuration is provided.public com.azure.core.util.polling.PollerFlux<CertificateOperation,KeyVaultCertificateWithPolicy> getCertificateOperation(String certificateName)
CertificateOperation from the key vault. This operation requires the certificates/get permission.
Code Samples
Get a pending certificate operation. The poller allows users to automatically poll on the certificate
operation status. It is possible to monitor each intermediate poll response during the poll operation.
certificateAsyncClient.getCertificateOperation("certificateName")
.subscribe(pollResponse -> {
System.out.println("---------------------------------------------------------------------------------");
System.out.println(pollResponse.getStatus());
System.out.println(pollResponse.getValue().getStatus());
System.out.println(pollResponse.getValue().getStatusDetails());
});
certificateName - The name of the certificate.PollerFlux polling on the certificate operation status.com.azure.core.exception.ResourceNotFoundException - when a certificate operation for a certificate with certificateName doesn't exist.public Mono<KeyVaultCertificateWithPolicy> getCertificate(String certificateName)
Code Samples
Gets a specific version of the certificate in the key vault. Prints out the returned certificate details when a response has been received.
certificateAsyncClient.getCertificate("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateResponse ->
System.out.printf("Certificate is returned with name %s and secretId %s %n",
certificateResponse.getProperties().getName(), certificateResponse.getSecretId()));
certificateName - The name of the certificate to retrieve, cannot be nullMono containing the requested certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if certificateName is empty string.public Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> getCertificateWithResponse(String certificateName)
Code Samples
Gets a specific version of the certificate in the key vault. Prints out the returned certificate details when a response has been received.
certificateAsyncClient.getCertificateWithResponse("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateResponse ->
System.out.printf("Certificate is returned with name %s and secretId %s %n",
certificateResponse.getValue().getProperties().getName(),
certificateResponse.getValue().getSecretId()));
certificateName - The name of the certificate to retrieve, cannot be nullMono containing a Response whose value contains the requested certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if certificateName is empty string.public Mono<com.azure.core.http.rest.Response<KeyVaultCertificate>> getCertificateVersionWithResponse(String certificateName, String version)
Code Samples
Gets a specific version of the certificate in the key vault. Prints out the returned certificate details when a response has been received.
String certificateVersion = "6A385B124DEF4096AF1361A85B16C204";
certificateAsyncClient.getCertificateVersionWithResponse("certificateName", certificateVersion)
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateWithVersion ->
System.out.printf("Certificate is returned with name %s and secretId %s %n",
certificateWithVersion.getValue().getProperties().getName(),
certificateWithVersion.getValue().getSecretId()));
certificateName - The name of the certificate to retrieve, cannot be nullversion - The version of the certificate to retrieve. If this is an empty String or null then latest version of the certificate is retrieved.Mono containing a Response whose value contains the requested certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if certificateName is empty string.public Mono<KeyVaultCertificate> getCertificateVersion(String certificateName, String version)
Code Samples
Gets a specific version of the certificate in the key vault. Prints out the returned certificate details when a response has been received.
certificateAsyncClient.getCertificateVersion("certificateName", certificateVersion)
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateWithVersion ->
System.out.printf("Certificate is returned with name %s and secretId %s %n",
certificateWithVersion.getProperties().getName(), certificateWithVersion.getSecretId()));
certificateName - The name of the certificate to retrieve, cannot be nullversion - The version of the certificate to retrieve. If this is an empty String or null then latest version of the certificate is retrieved.Mono containing the requested certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if certificateName is empty string.public Mono<KeyVaultCertificate> updateCertificateProperties(CertificateProperties properties)
Code Samples
Gets latest version of the certificate, changes its tags and enabled status and then updates it in the Azure Key Vault. Prints out the returned certificate details when a response has been received.
certificateAsyncClient.getCertificate("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateResponseValue -> {
KeyVaultCertificate certificate = certificateResponseValue;
//Update enabled status of the certificate
certificate.getProperties().setEnabled(false);
certificateAsyncClient.updateCertificateProperties(certificate.getProperties())
.subscribe(certificateResponse ->
System.out.printf("Certificate's enabled status %s %n",
certificateResponse.getProperties().isEnabled().toString()));
});
properties - The CertificateProperties object with updated properties.Mono containing the updated certificate.NullPointerException - if certificate is null.com.azure.core.exception.ResourceNotFoundException - when a certificate with name and version doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if name or version is empty string.public Mono<com.azure.core.http.rest.Response<KeyVaultCertificate>> updateCertificatePropertiesWithResponse(CertificateProperties properties)
Code Samples
Gets latest version of the certificate, changes its enabled status and then updates it in the Azure Key Vault. Prints out the returned certificate details when a response has been received.
certificateAsyncClient.getCertificate("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateResponseValue -> {
KeyVaultCertificate certificate = certificateResponseValue;
//Update the enabled status of the certificate.
certificate.getProperties().setEnabled(false);
certificateAsyncClient.updateCertificatePropertiesWithResponse(certificate.getProperties())
.subscribe(certificateResponse ->
System.out.printf("Certificate's enabled status %s %n",
certificateResponse.getValue().getProperties().isEnabled().toString()));
});
properties - The CertificateProperties object with updated properties.Mono containing a Response whose value contains the updated certificate.NullPointerException - if properties is null.com.azure.core.exception.ResourceNotFoundException - when a certificate with name and version doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if name or version is empty string.public com.azure.core.util.polling.PollerFlux<DeletedCertificate,Void> beginDeleteCertificate(String certificateName)
Code Samples
Deletes the certificate in the Azure Key Vault. Prints out the deleted certificate details when a response has been received.
certificateAsyncClient.beginDeleteCertificate("certificateName")
.subscribe(pollResponse -> {
System.out.println("Delete Status: " + pollResponse.getStatus().toString());
System.out.println("Delete Certificate Name: " + pollResponse.getValue().getName());
System.out.println("Certificate Delete Date: " + pollResponse.getValue().getDeletedOn().toString());
});
certificateName - The name of the certificate to be deleted.PollerFlux to poll on the deleted certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<DeletedCertificate> getDeletedCertificate(String certificateName)
Code Samples
Gets the deleted certificate from the key vault enabled for soft-delete. Prints out the deleted certificate details when a response has been received.
certificateAsyncClient.getDeletedCertificate("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(deletedSecretResponse ->
System.out.printf("Deleted Certificate's Recovery Id %s %n", deletedSecretResponse.getRecoveryId()));
certificateName - The name of the deleted certificate.Mono containing the deleted certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<com.azure.core.http.rest.Response<DeletedCertificate>> getDeletedCertificateWithResponse(String certificateName)
Code Samples
Gets the deleted certificate from the key vault enabled for soft-delete. Prints out the deleted certificate details when a response has been received.
certificateAsyncClient.getDeletedCertificateWithResponse("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(deletedSecretResponse ->
System.out.printf("Deleted Certificate's Recovery Id %s %n",
deletedSecretResponse.getValue().getRecoveryId()));
certificateName - The name of the deleted certificate.Mono containing a Response whose value contains the deleted certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<Void> purgeDeletedCertificate(String certificateName)
Code Samples
Purges the deleted certificate from the key vault enabled for soft-delete. Prints out the status code from the server response when a response has been received.
certificateAsyncClient.purgeDeletedCertificateWithResponse("deletedCertificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(purgeResponse ->
System.out.printf("Purge Status response %d %n", purgeResponse.getStatusCode()));
certificateName - The name of the deleted certificate.Mono.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<com.azure.core.http.rest.Response<Void>> purgeDeletedCertificateWithResponse(String certificateName)
Code Samples
Purges the deleted certificate from the key vault enabled for soft-delete. Prints out the status code from the server response when a response has been received.
certificateAsyncClient.purgeDeletedCertificateWithResponse("deletedCertificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(purgeResponse ->
System.out.printf("Purge Status response %d %n", purgeResponse.getStatusCode()));
certificateName - The name of the deleted certificate.Mono containing a Void Response}.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public com.azure.core.util.polling.PollerFlux<KeyVaultCertificateWithPolicy,Void> beginRecoverDeletedCertificate(String certificateName)
Code Samples
Recovers the deleted certificate from the key vault enabled for soft-delete. Prints out the recovered certificate details when a response has been received.
certificateAsyncClient.beginRecoverDeletedCertificate("deletedCertificateName")
.subscribe(pollResponse -> {
System.out.println("Recovery Status: " + pollResponse.getStatus().toString());
System.out.println("Recover Certificate Name: " + pollResponse.getValue().getName());
System.out.println("Recover Certificate Id: " + pollResponse.getValue().getId());
});
certificateName - The name of the deleted certificate to be recovered.PollerFlux to poll on the recovered certificate.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the certificate vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<byte[]> backupCertificate(String certificateName)
Code Samples
Backs up the certificate from the key vault. Prints out the length of the certificate's backup byte array returned in the response.
certificateAsyncClient.backupCertificate("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateBackupResponse ->
System.out.printf("Certificate's Backup Byte array's length %s %n", certificateBackupResponse.length));
certificateName - The name of the certificate.Mono containing the backed up certificate blob.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<com.azure.core.http.rest.Response<byte[]>> backupCertificateWithResponse(String certificateName)
Code Samples
Backs up the certificate from the key vault. Prints out the length of the certificate's backup byte array returned in the response.
certificateAsyncClient.backupCertificateWithResponse("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateBackupResponse ->
System.out.printf("Certificate's Backup Byte array's length %s %n",
certificateBackupResponse.getValue().length));
certificateName - The name of the certificate.Mono containing a Response whose value contains the backed up certificate blob.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<KeyVaultCertificateWithPolicy> restoreCertificateBackup(byte[] backup)
Code Samples
Restores the certificate in the key vault from its backup. Prints out the restored certificate details when a response has been received.
byte[] certificateBackupByteArray = {};
certificateAsyncClient.restoreCertificateBackup(certificateBackupByteArray)
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateResponse -> System.out.printf("Restored Certificate with name %s and key id %s %n",
certificateResponse.getProperties().getName(), certificateResponse.getKeyId()));
backup - The backup blob associated with the certificate.Mono containing the restored certificate.com.azure.core.exception.ResourceModifiedException - when backup blob is malformed.public Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> restoreCertificateBackupWithResponse(byte[] backup)
Code Samples
Restores the certificate in the key vault from its backup. Prints out the restored certificate details when a response has been received.
byte[] certificateBackup = {};
certificateAsyncClient.restoreCertificateBackup(certificateBackup)
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificateResponse -> System.out.printf("Restored Certificate with name %s and key id %s %n",
certificateResponse.getProperties().getName(), certificateResponse.getKeyId()));
backup - The backup blob associated with the certificate.Mono containing a Response whose value contains the restored certificate.com.azure.core.exception.ResourceModifiedException - when backup blob is malformed.public com.azure.core.http.rest.PagedFlux<CertificateProperties> listPropertiesOfCertificates(boolean includePending)
CertificateProperties as only the certificate identifier, thumbprint,
attributes and tags are provided in the response. The policy and individual certificate versions are not listed in
the response. This operation requires the certificates/list permission.
It is possible to get certificates with all the properties excluding the policy from this information. Convert the Flux containing CertificateProperties to
Flux containing certificate using CertificateAsyncClient.getCertificateVersion(String, String) within Flux.flatMap(Function).
certificateAsyncClient.listPropertiesOfCertificates()
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificate -> certificateAsyncClient.getCertificateVersion(certificate.getName(),
certificate.getVersion())
.subscribe(certificateResponse -> System.out.printf("Received certificate with name %s and key id %s",
certificateResponse.getName(), certificateResponse.getKeyId())));
includePending - indicate if pending certificates should be included in the results.PagedFlux containing certificate for all the certificates in the vault.public com.azure.core.http.rest.PagedFlux<CertificateProperties> listPropertiesOfCertificates()
CertificateProperties as only the certificate identifier, thumbprint,
attributes and tags are provided in the response. The policy and individual certificate versions are not listed in
the response. This operation requires the certificates/list permission.
It is possible to get certificates with all the properties excluding the policy from this information. Convert the Flux containing CertificateProperties to
Flux containing certificate using CertificateAsyncClient.getCertificateVersion(String, String) within Flux.flatMap(Function).
certificateAsyncClient.listPropertiesOfCertificates()
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificate -> certificateAsyncClient.getCertificateVersion(certificate.getName(),
certificate.getVersion())
.subscribe(certificateResponse -> System.out.printf("Received certificate with name %s and key id %s",
certificateResponse.getName(), certificateResponse.getKeyId())));
PagedFlux containing certificate for all the certificates in the vault.public com.azure.core.http.rest.PagedFlux<DeletedCertificate> listDeletedCertificates()
deleted certificates in the key vault currently available for recovery. This
operation includes deletion-specific information and is applicable for vaults enabled for soft-delete. This
operation requires the certificates/get/list permission.
Code Samples
Lists the deleted certificates in the key vault. Prints out the recovery id of each deleted certificate when a response has been received.
certificateAsyncClient.listDeletedCertificates()
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(deletedCertificateResponse -> System.out.printf("Deleted Certificate's Recovery Id %s %n",
deletedCertificateResponse.getRecoveryId()));
PagedFlux containing all of the deleted certificates in the vault.public com.azure.core.http.rest.PagedFlux<DeletedCertificate> listDeletedCertificates(boolean includePending)
deleted certificates in the key vault currently available for recovery. This
operation includes deletion-specific information and is applicable for vaults enabled for soft-delete. This
operation requires the certificates/get/list permission.
Code Samples
Lists the deleted certificates in the key vault. Prints out the recovery id of each deleted certificate when a response has been received.
certificateAsyncClient.listDeletedCertificates()
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(deletedCertificateResponse -> System.out.printf("Deleted Certificate's Recovery Id %s %n",
deletedCertificateResponse.getRecoveryId()));
includePending - indicate if pending deleted certificates should be included in the results.PagedFlux containing all of the deleted certificates in the vault.public com.azure.core.http.rest.PagedFlux<CertificateProperties> listPropertiesOfCertificateVersions(String certificateName)
CertificateProperties
as only the certificate identifier, thumbprint, attributes and tags are provided in the response. The policy is not listed in
the response. This operation requires the certificates/list permission.
It is possible to get the certificates with properties excluding the policy for all the versions from this information. Convert the PagedFlux
containing CertificateProperties to PagedFlux containing certificate using
CertificateAsyncClient.getCertificateVersion(String, String) within Flux.flatMap(Function).
certificateAsyncClient.listPropertiesOfCertificateVersions("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificate -> certificateAsyncClient.getCertificateVersion(certificate.getName(),
certificate.getVersion())
.subscribe(certificateResponse -> System.out.printf("Received certificate with name %s and key id %s",
certificateResponse.getProperties().getName(), certificateResponse.getKeyId())));
certificateName - The name of the certificate.PagedFlux containing certificate of all the versions of the specified certificate in the vault. Flux is empty if certificate with certificateName does not exist in key vault.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate with certificateName is empty string.public Mono<KeyVaultCertificate> mergeCertificate(MergeCertificateOptions mergeCertificateOptions)
certificates/create permission.
Code Samples
Merges a certificate with a kay pair available in the service.
List<byte[]> x509CertificatesToMerge = new ArrayList<>();
MergeCertificateOptions config =
new MergeCertificateOptions("certificateName", x509CertificatesToMerge).setEnabled(false);
certificateAsyncClient.mergeCertificate(config)
.subscribe(certificate -> System.out.printf("Received Certificate with name %s and key id %s",
certificate.getProperties().getName(), certificate.getKeyId()));
mergeCertificateOptions - the merge certificate options holding the x509 certificates.Mono containing the merged certificate.NullPointerException - when mergeCertificateOptions is null.com.azure.core.exception.HttpResponseException - if mergeCertificateOptions is invalid/corrupt.public Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> mergeCertificateWithResponse(MergeCertificateOptions mergeCertificateOptions)
certificates/create permission.
Code Samples
Merges a certificate with a kay pair available in the service.
List<byte[]> x509CertsToMerge = new ArrayList<>();
MergeCertificateOptions mergeConfig =
new MergeCertificateOptions("certificateName", x509CertsToMerge).setEnabled(false);
certificateAsyncClient.mergeCertificateWithResponse(mergeConfig)
.subscribe(certificateResponse -> System.out.printf("Received Certificate with name %s and key id %s",
certificateResponse.getValue().getProperties().getName(), certificateResponse.getValue().getKeyId()));
mergeCertificateOptions - the merge certificate options holding the x509 certificates.Mono containing a Response whose value contains the merged certificate.NullPointerException - when mergeCertificateOptions is null.com.azure.core.exception.HttpResponseException - if mergeCertificateOptions is invalid/corrupt.public Mono<CertificatePolicy> getCertificatePolicy(String certificateName)
certificates/get permission.
Code Samples
Gets the policy of a certirifcate in the key vault. Prints out the returned certificate policy details when a response has been received.
certificateAsyncClient.getCertificatePolicy("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(policy ->
System.out.printf("Certificate policy is returned with issuer name %s and subject name %s %n",
policy.getIssuerName(), policy.getSubject()));
certificateName - The name of the certificate whose policy is to be retrieved, cannot be nullMono containing a Response whose value contains the requested certificate policy.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if certificateName is empty string.public Mono<com.azure.core.http.rest.Response<CertificatePolicy>> getCertificatePolicyWithResponse(String certificateName)
certificates/get permission.
Code Samples
Gets the policy of a certirifcate in the key vault. Prints out the returned certificate policy details when a response has been received.
certificateAsyncClient.getCertificatePolicyWithResponse("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(policyResponse ->
System.out.printf("Certificate policy is returned with issuer name %s and subject name %s %n",
policyResponse.getValue().getIssuerName(), policyResponse.getValue().getSubject()));
certificateName - The name of the certificate whose policy is to be retrieved, cannot be nullMono containing the requested certificate policy.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if certificateName is empty string.public Mono<CertificatePolicy> updateCertificatePolicy(String certificateName, CertificatePolicy policy)
certificates/update permission.
Code Samples
Gets the certificate policy, changes its properties and then updates it in the Azure Key Vault. Prints out the returned policy details when a response has been received.
certificateAsyncClient.getCertificatePolicy("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificatePolicyResponseValue -> {
CertificatePolicy certificatePolicy = certificatePolicyResponseValue;
// Update transparency
certificatePolicy.setCertificateTransparent(true);
certificateAsyncClient.updateCertificatePolicy("certificateName", certificatePolicy)
.subscribe(updatedPolicy ->
System.out.printf("Certificate policy's updated transparency status %s %n",
updatedPolicy.isCertificateTransparent()));
});
certificateName - The name of the certificate whose policy is to be updated.policy - The certificate policy to be updated.Mono containing the updated certificate policy.NullPointerException - if policy is null.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if certificateName is empty string or if policy is invalid.public Mono<com.azure.core.http.rest.Response<CertificatePolicy>> updateCertificatePolicyWithResponse(String certificateName, CertificatePolicy policy)
certificates/update permission.
Code Samples
Gets the certificate policy, changes its properties and then updates it in the Azure Key Vault. Prints out the returned policy details when a response has been received.
certificateAsyncClient.getCertificatePolicy("certificateName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(certificatePolicyResponseValue -> {
CertificatePolicy certificatePolicy = certificatePolicyResponseValue;
// Update transparency
certificatePolicy.setCertificateTransparent(true);
certificateAsyncClient.updateCertificatePolicyWithResponse("certificateName",
certificatePolicy)
.subscribe(updatedPolicyResponse ->
System.out.printf("Certificate policy's updated transparency status %s %n",
updatedPolicyResponse.getValue().isCertificateTransparent()));
});
certificateName - The name of the certificate whose policy is to be updated.policy - The certificate policy is to be updated.Mono containing a Response whose value contains the updated certificate policy.NullPointerException - if policy is null.com.azure.core.exception.ResourceNotFoundException - when a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if name is empty string or if policy is invalid.public Mono<CertificateIssuer> createIssuer(CertificateIssuer issuer)
Code Samples
Creates a new certificate issuer in the key vault. Prints out the created certificate issuer details when a response has been received.
CertificateIssuer issuer = new CertificateIssuer("issuerName", "providerName")
.setAccountId("keyvaultuser")
.setPassword("temp2");
certificateAsyncClient.createIssuer(issuer)
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(issuerResponse -> {
System.out.printf("Issuer created with %s and %s", issuerResponse.getName(),
issuerResponse.getProvider());
});
issuer - The configuration of the certificate issuer to be created.Mono containing the created certificate issuer.com.azure.core.exception.ResourceModifiedException - when invalid certificate issuer issuer configuration is provided.com.azure.core.exception.HttpResponseException - when a certificate issuer with issuerName is empty string.public Mono<com.azure.core.http.rest.Response<CertificateIssuer>> createIssuerWithResponse(CertificateIssuer issuer)
Code Samples
Creates a new certificate issuer in the key vault. Prints out the created certificate issuer details when a response has been received.
CertificateIssuer newIssuer = new CertificateIssuer("issuerName", "providerName")
.setAccountId("keyvaultuser")
.setPassword("temp2");
certificateAsyncClient.createIssuerWithResponse(newIssuer)
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(issuerResponse -> {
System.out.printf("Issuer created with %s and %s", issuerResponse.getValue().getName(),
issuerResponse.getValue().getProvider());
});
issuer - The configuration of the certificate issuer to be created. Use
CertificateIssuer.CertificateIssuer(String, String) to initialize the issuer objectMono containing a Response whose value contains the created certificate issuer.com.azure.core.exception.ResourceModifiedException - when invalid certificate issuer issuer configuration is provided.com.azure.core.exception.HttpResponseException - when a certificate issuer with name is empty string.public Mono<com.azure.core.http.rest.Response<CertificateIssuer>> getIssuerWithResponse(String issuerName)
Code Samples
Gets the specificed certifcate issuer in the key vault. Prints out the returned certificate issuer details when a response has been received.
certificateAsyncClient.getIssuerWithResponse("issuerName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(issuerResponse -> {
System.out.printf("Issuer returned with %s and %s", issuerResponse.getValue().getName(),
issuerResponse.getValue().getProvider());
});
issuerName - The name of the certificate issuer to retrieve, cannot be nullMono containing a Response whose value contains the requested certificate issuer.com.azure.core.exception.ResourceNotFoundException - when a certificate issuer with issuerName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if issuerName is empty string.public Mono<CertificateIssuer> getIssuer(String issuerName)
Code Samples
Gets the specified certificate issuer in the key vault. Prints out the returned certificate issuer details when a response has been received.
certificateAsyncClient.getIssuer("issuerName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(issuer -> {
System.out.printf("Issuer returned with %s and %s", issuer.getName(),
issuer.getProvider());
});
issuerName - The name of the certificate to retrieve, cannot be nullMono containing the requested certificate issuer.com.azure.core.exception.ResourceNotFoundException - when a certificate issuer with issuerName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if issuerName is empty string.public Mono<com.azure.core.http.rest.Response<CertificateIssuer>> deleteIssuerWithResponse(String issuerName)
certificates/manageissuers/deleteissuers permission.
Code Samples
Deletes the certificate issuer in the Azure Key Vault. Prints out the deleted certificate details when a response has been received.
certificateAsyncClient.deleteIssuerWithResponse("issuerName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(deletedIssuerResponse ->
System.out.printf("Deleted issuer with name %s %n", deletedIssuerResponse.getValue().getName()));
issuerName - The name of the certificate issuer to be deleted.Mono containing a Response whose value contains the deleted issuer.com.azure.core.exception.ResourceNotFoundException - when a certificate issuer with issuerName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate issuer with issuerName is empty string.public Mono<CertificateIssuer> deleteIssuer(String issuerName)
certificates/manageissuers/deleteissuers permission.
Code Samples
Deletes the certificate issuer in the Azure Key Vault. Prints out the deleted certificate details when a response has been received.
certificateAsyncClient.deleteIssuer("issuerName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(deletedIssuerResponse ->
System.out.printf("Deleted issuer with name %s %n", deletedIssuerResponse.getName()));
issuerName - The name of the certificate issuer to be deleted.Mono containing the deleted issuer.com.azure.core.exception.ResourceNotFoundException - when a certificate issuer with issuerName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when a certificate issuer with issuerName is empty string.public com.azure.core.http.rest.PagedFlux<IssuerProperties> listPropertiesOfIssuers()
IssuerProperties
as only the certificate issuer identifier and provider are provided in the response. This operation requires the
certificates/manageissuers/getissuers permission.
It is possible to get the certificate issuer with all of its properties from this information. Convert the PagedFlux
containing issuerProperties to PagedFlux containing issuer using
CertificateAsyncClient.getIssuer(String)
certificateAsyncClient.listPropertiesOfIssuers()
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(issuerProperties -> certificateAsyncClient.getIssuer(issuerProperties.getName())
.subscribe(issuerResponse -> System.out.printf("Received issuer with name %s and provider %s",
issuerResponse.getName(), issuerResponse.getProvider())));
PagedFlux containing all of the certificate issuers in the vault.public Mono<CertificateIssuer> updateIssuer(CertificateIssuer issuer)
Code Samples
Gets the certificate issuer, changes its attributes/properties then updates it in the Azure Key Vault. Prints out the returned certificate issuer details when a response has been received.
certificateAsyncClient.getIssuer("issuerName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(issuerResponseValue -> {
CertificateIssuer issuer = issuerResponseValue;
//Update the enabled status of the issuer.
issuer.setEnabled(false);
certificateAsyncClient.updateIssuer(issuer)
.subscribe(issuerResponse ->
System.out.printf("Issuer's enabled status %s %n",
issuerResponse.isEnabled().toString()));
});
issuer - The issuer with updated properties. Use
CertificateIssuer.CertificateIssuer(String) to initialize the issuer objectMono containing the updated issuer.NullPointerException - if issuer is null.com.azure.core.exception.ResourceNotFoundException - when a certificate issuer with name doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if name is empty string.public Mono<com.azure.core.http.rest.Response<CertificateIssuer>> updateIssuerWithResponse(CertificateIssuer issuer)
Code Samples
Gets the certificate issuer, changes its attributes/properties then updates it in the Azure Key Vault. Prints out the returned certificate issuer details when a response has been received.
certificateAsyncClient.getIssuer("issuerName")
.subscriberContext(Context.of(key1, value1, key2, value2))
.subscribe(issuerResponseValue -> {
CertificateIssuer issuer = issuerResponseValue;
//Update the enabled status of the issuer.
issuer.setEnabled(false);
certificateAsyncClient.updateIssuer(issuer)
.subscribe(issuerResponse ->
System.out.printf("Issuer's enabled status %s %n",
issuerResponse.isEnabled().toString()));
});
issuer - The issuer with updated properties.Mono containing a Response whose value contains the updated issuer.NullPointerException - if issuer is null.com.azure.core.exception.ResourceNotFoundException - when a certificate issuer with name doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - if name is empty string.public com.azure.core.http.rest.PagedFlux<CertificateContact> setContacts(List<CertificateContact> contacts)
certificates/managecontacts permission.
The LifetimeAction of type CertificatePolicyAction.EMAIL_CONTACTS set on a CertificatePolicy emails the contacts set on the vault when triggered.
Code Samples
Sets the certificate contacts in the Azure Key Vault. Prints out the returned contacts details.
CertificateContact contactToAdd = new CertificateContact().setName("user").setEmail("useremail{@literal @}example.com");
certificateAsyncClient.setContacts(Collections.singletonList(contactToAdd)).subscribe(contact ->
System.out.printf("Contact name %s and email %s", contact.getName(), contact.getEmail())
);
contacts - The list of contacts to set on the vault.PagedFlux containing all of the certificate contacts in the vault.com.azure.core.exception.HttpResponseException - when a contact information provided is invalid/incomplete.public com.azure.core.http.rest.PagedFlux<CertificateContact> listContacts()
Code Samples
Lists the certificate contacts in the Azure Key Vault. Prints out the returned contacts details.
certificateAsyncClient.listContacts().subscribe(contact ->
System.out.printf("Contact name %s and email %s", contact.getName(), contact.getEmail())
);
PagedFlux containing all of the certificate contacts in the vault.public com.azure.core.http.rest.PagedFlux<CertificateContact> deleteContacts()
certificates/managecontacts permission.
Code Samples
Deletes the certificate contacts in the Azure Key Vault. Prints out the deleted contacts details.
certificateAsyncClient.deleteContacts().subscribe(contact ->
System.out.printf("Deleted Contact name %s and email %s", contact.getName(), contact.getEmail())
);
PagedFlux containing all of the deleted certificate contacts in the vault.public Mono<CertificateOperation> deleteCertificateOperation(String certificateName)
certificates/update permission.
Code Samples
Triggers certificate creation and then deletes the certificate creation operation in the Azure Key Vault. Prints out the deleted certificate operation details when a response has been received.
certificateAsyncClient.deleteCertificateOperation("certificateName")
.subscribe(certificateOperation -> System.out.printf("Deleted Certificate operation last status %s",
certificateOperation.getStatus()));
certificateName - The name of the certificate which is in the process of being created.Mono containing a Response whose value contains the deleted certificate operation.com.azure.core.exception.ResourceNotFoundException - when a certificate operation for a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when the certificateName is empty string.public Mono<com.azure.core.http.rest.Response<CertificateOperation>> deleteCertificateOperationWithResponse(String certificateName)
certificates/update permission.
Code Samples
Triggers certificate creation and then deletes the certificate creation operation in the Azure Key Vault. Prints out the deleted certificate operation details when a response has been received.
certificateAsyncClient.deleteCertificateOperationWithResponse("certificateName")
.subscribe(certificateOperationResponse -> System.out.printf("Deleted Certificate operation's last"
+ " status %s", certificateOperationResponse.getValue().getStatus()));
certificateName - The name of the certificate which is in the process of being created.Mono containing the deleted certificate operation.com.azure.core.exception.ResourceNotFoundException - when a certificate operation for a certificate with certificateName doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when the certificateName is empty string.public Mono<CertificateOperation> cancelCertificateOperation(String certificateName)
certificates/update permission.
Code Samples
Triggers certificate creation and then cancels the certificate creation operation in the Azure Key Vault. Prints out the updated certificate operation details when a response has been received.
certificateAsyncClient.cancelCertificateOperation("certificateName")
.subscribe(certificateOperation -> System.out.printf("Certificate operation status %s",
certificateOperation.getStatus()));
certificateName - The name of the certificate which is in the process of being created.Mono containing a Response whose value contains the cancelled certificate operation.com.azure.core.exception.ResourceNotFoundException - when a certificate operation for a certificate with name doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when the name is empty string.public Mono<com.azure.core.http.rest.Response<CertificateOperation>> cancelCertificateOperationWithResponse(String certificateName)
certificates/update permission.
Code Samples
Triggers certificate creation and then cancels the certificate creation operation in the Azure Key Vault. Prints out the updated certificate operation details when a response has been received.
certificateAsyncClient.cancelCertificateOperationWithResponse("certificateName")
.subscribe(certificateOperationResponse -> System.out.printf("Certificate operation status %s",
certificateOperationResponse.getValue().getStatus()));
certificateName - The name of the certificate which is in the process of being created.Mono containing a Response whose value contains the cancelled certificate operation.com.azure.core.exception.ResourceNotFoundException - when a certificate operation for a certificate with name doesn't exist in the key vault.com.azure.core.exception.HttpResponseException - when the name is empty string.public Mono<KeyVaultCertificateWithPolicy> importCertificate(ImportCertificateOptions importCertificateOptions)
certificates/import permission.
Code Samples
Imports a certificate into the key vault.
byte[] certificateToImport = new byte[100];
ImportCertificateOptions config =
new ImportCertificateOptions("certificateName", certificateToImport).setEnabled(false);
certificateAsyncClient.importCertificate(config)
.subscribe(certificate -> System.out.printf("Received Certificate with name %s and key id %s",
certificate.getProperties().getName(), certificate.getKeyId()));
importCertificateOptions - The details of the certificate to import to the key vaultResponse whose value contains the imported certificate.com.azure.core.exception.HttpResponseException - when the importCertificateOptions are invalid.public Mono<com.azure.core.http.rest.Response<KeyVaultCertificateWithPolicy>> importCertificateWithResponse(ImportCertificateOptions importCertificateOptions)
certificates/import permission.
Code Samples
Imports a certificate into the key vault.
byte[] certToImport = new byte[100];
ImportCertificateOptions importCertificateOptions =
new ImportCertificateOptions("certificateName", certToImport).setEnabled(false);
certificateAsyncClient.importCertificateWithResponse(importCertificateOptions)
.subscribe(certificateResponse -> System.out.printf("Received Certificate with name %s and key id %s",
certificateResponse.getValue().getProperties().getName(), certificateResponse.getValue().getKeyId()));
importCertificateOptions - The details of the certificate to import to the key vaultMono containing a Response whose value contains the imported certificate.com.azure.core.exception.HttpResponseException - when the importCertificateOptions are invalid.Copyright © 2021 Microsoft Corporation. All rights reserved.