KeyVaultClient Class

  • java.lang.Object
    • com.microsoft.azure.keyvault.KeyVaultClient

public class KeyVaultClient

Initializes a new instance of the KeyVaultClient class.

Constructor Summary

Constructor Description
KeyVaultClient(RestClient restClient)

Initializes an instance of KeyVaultClient client.

KeyVaultClient(ServiceClientCredentials credentials)

Initializes an instance of KeyVaultClient client.

Method Summary

Modifier and Type Method and Description
String acceptLanguage()

Gets Gets or sets the preferred language for the response.

String apiVersion()

Gets Client Api Version.

BackupKeyResult backupKey(String vaultBaseUrl, String keyName)

Requests that a backup of the specified key be downloaded to the client.

ServiceFuture<BackupKeyResult> backupKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<BackupKeyResult> serviceCallback)

Requests that a backup of the specified key be downloaded to the client.

CertificateOperation createCertificate(CreateCertificateRequest createCertificateRequest)

Creates a new certificate version. If this is the first version, the certificate resource is created.

ServiceFuture<CertificateOperation> createCertificateAsync(CreateCertificateRequest createCertificateRequest, final ServiceCallback<CertificateOperation> serviceCallback)

Creates a new certificate version. If this is the first version, the certificate resource is created.

KeyBundle createKey(CreateKeyRequest createKeyRequest)

Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission.

ServiceFuture<KeyBundle> createKeyAsync(CreateKeyRequest createKeyRequest, ServiceCallback<KeyBundle> serviceCallback)

Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission.

KeyOperationResult decrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Decrypts a single block of encrypted data.

ServiceFuture<KeyOperationResult> decryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback)

Decrypts a single block of encrypted data.

CertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName)

Deletes a certificate from the specified vault.

ServiceFuture<CertificateBundle> deleteCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<CertificateBundle> serviceCallback)

Deletes a certificate from the specified vault.

Contacts deleteCertificateContacts(String vaultBaseUrl)

Deletes the certificate contacts for the specified vault.

ServiceFuture<Contacts> deleteCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback<Contacts> serviceCallback)

Deletes the certificate contacts for the specified vault.

IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName)

Deletes the specified certificate issuer.

ServiceFuture<IssuerBundle> deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback<IssuerBundle> serviceCallback)

Deletes the specified certificate issuer.

CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName)

Deletes the operation for a specified certificate.

ServiceFuture<CertificateOperation> deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<CertificateOperation> serviceCallback)

Deletes the operation for a specified certificate.

KeyBundle deleteKey(String vaultBaseUrl, String keyName)

Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission.

ServiceFuture<KeyBundle> deleteKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback)

Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission.

SecretBundle deleteSecret(String vaultBaseUrl, String secretName)

Deletes a secret from the specified vault.

ServiceFuture<SecretBundle> deleteSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback<SecretBundle> serviceCallback)

Deletes a secret from the specified vault.

KeyOperationResult encrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

ServiceFuture<KeyOperationResult> encryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

boolean generateClientRequestId()

Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.

AzureClient getAzureClient()

Gets the AzureClient used for long running operations.

CertificateBundle getCertificate(String certificateIdentifier)

Gets information about a specified certificate.

CertificateBundle getCertificate(String vaultBaseUrl, String certificateName)

Gets information about a specified certificate.

CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion)

Gets information about a specified certificate.

ServiceFuture<CertificateBundle> getCertificateAsync(String certificateIdentifier, final ServiceCallback<CertificateBundle> serviceCallback)

Gets information about a specified certificate.

ServiceFuture<CertificateBundle> getCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<CertificateBundle> serviceCallback)

Gets information about a specified certificate.

ServiceFuture<CertificateBundle> getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback<CertificateBundle> serviceCallback)

Gets information about a specified certificate.

Contacts getCertificateContacts(String vaultBaseUrl)

Gets the certificate contacts for the specified vault.

ServiceFuture<Contacts> getCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback<Contacts> serviceCallback)

Gets the certificate contacts for the specified vault.

IssuerBundle getCertificateIssuer(String vaultBaseUrl, String issuerName)

Gets the specified certificate issuer.

ServiceFuture<IssuerBundle> getCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback<IssuerBundle> serviceCallback)

Gets the specified certificate issuer.

CertificateOperation getCertificateOperation(String vaultBaseUrl, String certificateName)

Gets the operation associated with a specified certificate.

ServiceFuture<CertificateOperation> getCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<CertificateOperation> serviceCallback)

Gets the operation associated with a specified certificate.

CertificatePolicy getCertificatePolicy(String vaultBaseUrl, String certificateName)

Gets the policy for a certificate.

ServiceFuture<CertificatePolicy> getCertificatePolicyAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<CertificatePolicy> serviceCallback)

Gets the policy for a certificate.

KeyBundle getKey(String keyIdentifier)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

KeyBundle getKey(String vaultBaseUrl, String keyName)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

KeyBundle getKey(String vaultBaseUrl, String keyName, String keyVersion)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

ServiceFuture<KeyBundle> getKeyAsync(String keyIdentifier, final ServiceCallback<KeyBundle> serviceCallback)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

ServiceFuture<KeyBundle> getKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

ServiceFuture<KeyBundle> getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback<KeyBundle> serviceCallback)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName)

Gets the pending certificate signing request response.

ServiceFuture<String> getPendingCertificateSigningRequestAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<String> serviceCallback)

Gets the pending certificate signing request response.

SecretBundle getSecret(String secretIdentifier)

Get a specified secret from a given key vault.

SecretBundle getSecret(String vaultBaseUrl, String secretName)

Get a specified secret from a given key vault.

SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion)

Get a specified secret from a given key vault.

ServiceFuture<SecretBundle> getSecretAsync(String secretIdentifier, final ServiceCallback<SecretBundle> serviceCallback)

Get a specified secret from a given key vault.

ServiceFuture<SecretBundle> getSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback<SecretBundle> serviceCallback)

Get a specified secret from a given key vault.

ServiceFuture<SecretBundle> getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback<SecretBundle> serviceCallback)

Get a specified secret from a given key vault.

OkHttpClient httpClient()
CertificateBundle importCertificate(ImportCertificateRequest importCertificateRequest)

Imports a certificate into the specified vault.

ServiceFuture<CertificateBundle> importCertificateAsync(ImportCertificateRequest importCertificateRequest, final ServiceCallback<CertificateBundle> serviceCallback)

Imports a certificate into the specified vault.

KeyBundle importKey(ImportKeyRequest importKeyRequest)

Imports an externally created key, stores it, and returns key parameters and attributes to the client. 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. Authorization: requires the keys/import permission.

ServiceFuture<KeyBundle> importKeyAsync(ImportKeyRequest importKeyRequest, final ServiceCallback<KeyBundle> serviceCallback)

Imports an externally created key, stores it, and returns key parameters and attributes to the client. 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. Authorization: requires the keys/import permission.

PagedList<CertificateIssuerItem> listCertificateIssuers(final String vaultBaseUrl)

List certificate issuers for the specified vault.

PagedList<CertificateIssuerItem> listCertificateIssuers(final String vaultBaseUrl, final Integer maxresults)

List certificate issuers for the specified vault.

ServiceFuture<List<CertificateIssuerItem>> listCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback<CertificateIssuerItem> serviceCallback)

List certificate issuers for the specified vault.

ServiceFuture<List<CertificateIssuerItem>> listCertificateIssuersAsync(final String vaultBaseUrl, final ListOperationCallback<CertificateIssuerItem> serviceCallback)

List certificate issuers for the specified vault.

PagedList<CertificateItem> listCertificates(final String vaultBaseUrl)

List certificates in the specified vault.

PagedList<CertificateItem> listCertificates(final String vaultBaseUrl, final Integer maxresults)

List certificates in the specified vault.

ServiceFuture<List<CertificateItem>> listCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback<CertificateItem> serviceCallback)

List certificates in the specified vault.

ServiceFuture<List<CertificateItem>> listCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback<CertificateItem> serviceCallback)

List certificates in the specified vault.

PagedList<CertificateItem> listCertificateVersions(final String vaultBaseUrl, final String certificateName)

List the versions of a certificate.

PagedList<CertificateItem> listCertificateVersions(final String vaultBaseUrl, final String certificateName, final Integer maxresults)

List the versions of a certificate.

ServiceFuture<List<CertificateItem>> listCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults, final ListOperationCallback<CertificateItem> serviceCallback)

List the versions of a certificate.

ServiceFuture<List<CertificateItem>> listCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final ListOperationCallback<CertificateItem> serviceCallback)

List the versions of a certificate.

PagedList<KeyItem> listKeys(final String vaultBaseUrl)

List keys in the specified vault.

PagedList<KeyItem> listKeys(final String vaultBaseUrl, final Integer maxresults)

List keys in the specified vault.

ServiceFuture<List<KeyItem>> listKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback<KeyItem> serviceCallback)

List keys in the specified vault.

ServiceFuture<List<KeyItem>> listKeysAsync(final String vaultBaseUrl, final ListOperationCallback<KeyItem> serviceCallback)

List keys in the specified vault.

PagedList<KeyItem> listKeyVersions(final String vaultBaseUrl, final String keyName)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

PagedList<KeyItem> listKeyVersions(final String vaultBaseUrl, final String keyName, final Integer maxresults)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

ServiceFuture<List<KeyItem>> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults, final ListOperationCallback<KeyItem> serviceCallback)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

ServiceFuture<List<KeyItem>> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final ListOperationCallback<KeyItem> serviceCallback)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

PagedList<SecretItem> listSecrets(final String vaultBaseUrl)

List secrets in the specified vault.

PagedList<SecretItem> listSecrets(final String vaultBaseUrl, final Integer maxresults)

List secrets in the specified vault.

ServiceFuture<List<SecretItem>> listSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback<SecretItem> serviceCallback)

List secrets in the specified vault.

ServiceFuture<List<SecretItem>> listSecretsAsync(final String vaultBaseUrl, final ListOperationCallback<SecretItem> serviceCallback)

List secrets in the specified vault.

PagedList<SecretItem> listSecretVersions(final String vaultBaseUrl, final String secretName)

List the versions of the specified secret.

PagedList<SecretItem> listSecretVersions(final String vaultBaseUrl, final String secretName, final Integer maxresults)

List the versions of the specified secret.

ServiceFuture<List<SecretItem>> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults, final ListOperationCallback<SecretItem> serviceCallback)

List the versions of the specified secret.

ServiceFuture<List<SecretItem>> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final ListOperationCallback<SecretItem> serviceCallback)

List the versions of the specified secret.

int longRunningOperationRetryTimeout()

Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.

CertificateBundle mergeCertificate(MergeCertificateRequest mergeCertificateRequest)

Merges a certificate or a certificate chain with a key pair existing on the server.

ServiceFuture<CertificateBundle> mergeCertificateAsync(MergeCertificateRequest mergeCertificateRequest, final ServiceCallback<CertificateBundle> serviceCallback)

Merges a certificate or a certificate chain with a key pair existing on the server.

RestClient restClient()
KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup)

Restores the backup key in to a vault.

ServiceFuture<KeyBundle> restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup, final ServiceCallback<KeyBundle> serviceCallback)

Restores the backup key in to a vault.

Retrofit retrofit()
SerializerAdapter<?> serializerAdapter()
Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts)

Sets the certificate contacts for the specified vault.

ServiceFuture<Contacts> setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts, final ServiceCallback<Contacts> serviceCallback)

Sets the certificate contacts for the specified vault.

IssuerBundle setCertificateIssuer(SetCertificateIssuerRequest setCertificateIssuerRequest)

Sets the certificate contacts for the specified vault.

ServiceFuture<IssuerBundle> setCertificateIssuerAsync(SetCertificateIssuerRequest setCertificateIssuerRequest, final ServiceCallback<IssuerBundle> serviceCallback)

Sets the certificate contacts for the specified vault.

SecretBundle setSecret(SetSecretRequest setSecretRequest)

Sets a secret in the specified vault.

ServiceFuture<SecretBundle> setSecretAsync(SetSecretRequest setSecretRequest, final ServiceCallback<SecretBundle> serviceCallback)

Sets a secret in the specified vault.

KeyOperationResult sign(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value)

Creates a signature from a digest using the specified key.

ServiceFuture<KeyOperationResult> signAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback)

Creates a signature from a digest using the specified key.

KeyOperationResult unwrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Unwraps a symmetric key using the specified key in the vault that has initially been used for wrapping the key.

ServiceFuture<KeyOperationResult> unwrapKeyAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback)

Unwraps a symmetric key using the specified key in the vault that has initially been used for wrapping the key.

CertificateBundle updateCertificate(UpdateCertificateRequest updateCertificateRequest)

Updates the attributes associated with the specified certificate.

ServiceFuture<CertificateBundle> updateCertificateAsync(UpdateCertificateRequest updateCertificateRequest, final ServiceCallback<CertificateBundle> serviceCallback)

Updates the attributes associated with the specified certificate.

IssuerBundle updateCertificateIssuer(UpdateCertificateIssuerRequest updateCertificateIssuerRequest)

Updates the specified certificate issuer.

ServiceFuture<IssuerBundle> updateCertificateIssuerAsync(UpdateCertificateIssuerRequest updateCertificateIssuerRequest, final ServiceCallback<IssuerBundle> serviceCallback)

Updates the specified certificate issuer.

CertificateOperation updateCertificateOperation(UpdateCertificateOperationRequest updateCertificateOperationRequest)

Updates a certificate operation.

ServiceFuture<CertificateOperation> updateCertificateOperationAsync(UpdateCertificateOperationRequest updateCertificateOperationRequest, final ServiceCallback<CertificateOperation> serviceCallback)

Updates a certificate operation.

CertificatePolicy updateCertificatePolicy(UpdateCertificatePolicyRequest updateCertificatePolicyRequest)

Updates the policy for a certificate. Set appropriate members in the certificatePolicy that must be updated. Leave others as null.

ServiceFuture<CertificatePolicy> updateCertificatePolicyAsync(UpdateCertificatePolicyRequest updateCertificatePolicyRequest, final ServiceCallback<CertificatePolicy> serviceCallback)

Updates the policy for a certificate. Set appropriate members in the certificatePolicy that must be updated. Leave others as null.

KeyBundle updateKey(UpdateKeyRequest updateKeyRequest)

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission.

ServiceFuture<KeyBundle> updateKeyAsync(UpdateKeyRequest updateKeyRequest, final ServiceCallback<KeyBundle> serviceCallback)

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission.

SecretBundle updateSecret(UpdateSecretRequest updateSecretRequest)

Updates the attributes associated with a specified secret in a given key vault.

ServiceFuture<SecretBundle> updateSecretAsync(UpdateSecretRequest updateSecretRequest, final ServiceCallback<SecretBundle> serviceCallback)

Updates the attributes associated with a specified secret in a given key vault.

String userAgent()

Gets the User-Agent header for the client.

KeyVerifyResult verify(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature)

Verifies a signature using the specified key.

ServiceFuture<KeyVerifyResult> verifyAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature, final ServiceCallback<KeyVerifyResult> serviceCallback)

Verifies a signature using the specified key.

void withAcceptLanguage(String acceptLanguage)

Sets Gets or sets the preferred language for the response.

void withGenerateClientRequestId(boolean generateClientRequestId)

Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.

void withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout)

Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.

KeyOperationResult wrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Wraps a symmetric key using the specified key.

ServiceFuture<KeyOperationResult> wrapKeyAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback)

Wraps a symmetric key using the specified key.

Constructor Details

KeyVaultClient

public KeyVaultClient(RestClient restClient)

Initializes an instance of KeyVaultClient client.

Parameters:

restClient - the REST client to connect to Azure.

KeyVaultClient

public KeyVaultClient(ServiceClientCredentials credentials)

Initializes an instance of KeyVaultClient client.

Parameters:

credentials - the management credentials for Azure

Method Details

acceptLanguage

public String acceptLanguage()

Gets Gets or sets the preferred language for the response.

Returns:

the acceptLanguage value.

apiVersion

public String apiVersion()

Gets Client Api Version.

Returns:

the apiVersion value.

backupKey

public BackupKeyResult backupKey(String vaultBaseUrl, String keyName)

Requests that a backup of the specified key be downloaded to the client.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key

Returns:

the BackupKeyResult if successful.

backupKeyAsync

public ServiceFuture backupKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback)

Requests that a backup of the specified key be downloaded to the client.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

createCertificate

public CertificateOperation createCertificate(CreateCertificateRequest createCertificateRequest)

Creates a new certificate version. If this is the first version, the certificate resource is created.

Parameters:

createCertificateRequest - the grouped properties for creating a certificate request

Returns:

the CertificateOperation if successful.

createCertificateAsync

public ServiceFuture createCertificateAsync(CreateCertificateRequest createCertificateRequest, final ServiceCallback serviceCallback)

Creates a new certificate version. If this is the first version, the certificate resource is created.

Parameters:

createCertificateRequest - the grouped properties for creating a certificate request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

createKey

public KeyBundle createKey(CreateKeyRequest createKeyRequest)

Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission.

Parameters:

createKeyRequest - the grouped properties for creating a key request

Returns:

the KeyBundle if successful.

createKeyAsync

public ServiceFuture createKeyAsync(CreateKeyRequest createKeyRequest, ServiceCallback serviceCallback)

Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission.

Parameters:

createKeyRequest - the grouped properties for creating a key request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

decrypt

public KeyOperationResult decrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Decrypts a single block of encrypted data.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the content to be decrypted

Returns:

the KeyOperationResult if successful.

decryptAsync

public ServiceFuture decryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback)

Decrypts a single block of encrypted data.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the content to be decrypted
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

deleteCertificate

public CertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName)

Deletes a certificate from the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault

Returns:

the CertificateBundle if successful.

deleteCertificateAsync

public ServiceFuture deleteCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback)

Deletes a certificate from the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

deleteCertificateContacts

public Contacts deleteCertificateContacts(String vaultBaseUrl)

Deletes the certificate contacts for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net

Returns:

the Contacts if successful.

deleteCertificateContactsAsync

public ServiceFuture deleteCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback)

Deletes the certificate contacts for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

deleteCertificateIssuer

public IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName)

Deletes the specified certificate issuer.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
issuerName - The name of the issuer.

Returns:

the IssuerBundle if successful.

deleteCertificateIssuerAsync

public ServiceFuture deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback)

Deletes the specified certificate issuer.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
issuerName - The name of the issuer.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

deleteCertificateOperation

public CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName)

Deletes the operation for a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate

Returns:

the CertificateOperation if successful.

deleteCertificateOperationAsync

public ServiceFuture deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback)

Deletes the operation for a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

deleteKey

public KeyBundle deleteKey(String vaultBaseUrl, String keyName)

Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key

Returns:

the KeyBundle if successful.

deleteKeyAsync

public ServiceFuture deleteKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback)

Deletes a key of any type from storage in Azure Key Vault. The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. Authorization: Requires the keys/delete permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

deleteSecret

public SecretBundle deleteSecret(String vaultBaseUrl, String secretName)

Deletes a secret from the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault

Returns:

the SecretBundle if successful.

deleteSecretAsync

public ServiceFuture deleteSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback)

Deletes a secret from the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

encrypt

public KeyOperationResult encrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the content to be encrypted

Returns:

the KeyOperationResult if successful.

encryptAsync

public ServiceFuture encryptAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback)

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the content to be encrypted
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

generateClientRequestId

public boolean generateClientRequestId()

Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.

Returns:

the generateClientRequestId value.

getAzureClient

public AzureClient getAzureClient()

Gets the AzureClient used for long running operations.

Returns:

the azure client;

getCertificate

public CertificateBundle getCertificate(String certificateIdentifier)

Gets information about a specified certificate.

Parameters:

certificateIdentifier - The certificate identifier

Returns:

the CertificateBundle if successful.

getCertificate

public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName)

Gets information about a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault

Returns:

the CertificateBundle if successful.

getCertificate

public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion)

Gets information about a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault
certificateVersion - The version of the certificate

Returns:

the CertificateBundle if successful.

getCertificateAsync

public ServiceFuture getCertificateAsync(String certificateIdentifier, final ServiceCallback serviceCallback)

Gets information about a specified certificate.

Parameters:

certificateIdentifier - The certificate identifier
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getCertificateAsync

public ServiceFuture getCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback)

Gets information about a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getCertificateAsync

public ServiceFuture getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback serviceCallback)

Gets information about a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault
certificateVersion - The version of the certificate
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getCertificateContacts

public Contacts getCertificateContacts(String vaultBaseUrl)

Gets the certificate contacts for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net

Returns:

the Contacts if successful.

getCertificateContactsAsync

public ServiceFuture getCertificateContactsAsync(String vaultBaseUrl, final ServiceCallback serviceCallback)

Gets the certificate contacts for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getCertificateIssuer

public IssuerBundle getCertificateIssuer(String vaultBaseUrl, String issuerName)

Gets the specified certificate issuer.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
issuerName - The name of the issuer.

Returns:

the IssuerBundle if successful.

getCertificateIssuerAsync

public ServiceFuture getCertificateIssuerAsync(String vaultBaseUrl, String issuerName, final ServiceCallback serviceCallback)

Gets the specified certificate issuer.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
issuerName - The name of the issuer.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getCertificateOperation

public CertificateOperation getCertificateOperation(String vaultBaseUrl, String certificateName)

Gets the operation associated with a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate

Returns:

the CertificateOperation if successful.

getCertificateOperationAsync

public ServiceFuture getCertificateOperationAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback)

Gets the operation associated with a specified certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getCertificatePolicy

public CertificatePolicy getCertificatePolicy(String vaultBaseUrl, String certificateName)

Gets the policy for a certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault.

Returns:

the CertificatePolicy if successful.

getCertificatePolicyAsync

public ServiceFuture getCertificatePolicyAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback)

Gets the policy for a certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate in the given vault.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getKey

public KeyBundle getKey(String keyIdentifier)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

Parameters:

keyIdentifier - The full key identifier

Returns:

the KeyBundle if successful.

getKey

public KeyBundle getKey(String vaultBaseUrl, String keyName)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key

Returns:

the KeyBundle if successful.

getKey

public KeyBundle getKey(String vaultBaseUrl, String keyName, String keyVersion)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
keyVersion - The version of the key

Returns:

the KeyBundle if successful.

getKeyAsync

public ServiceFuture getKeyAsync(String keyIdentifier, final ServiceCallback serviceCallback)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

Parameters:

keyIdentifier - The full key identifier
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getKeyAsync

public ServiceFuture getKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback serviceCallback)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getKeyAsync

public ServiceFuture getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback serviceCallback)

Gets the public part of a stored key. The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. Authorization: Requires the keys/get permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
keyVersion - The version of the key
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getPendingCertificateSigningRequest

public String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName)

Gets the pending certificate signing request response.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate

Returns:

the String if successful.

getPendingCertificateSigningRequestAsync

public ServiceFuture getPendingCertificateSigningRequestAsync(String vaultBaseUrl, String certificateName, final ServiceCallback serviceCallback)

Gets the pending certificate signing request response.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getSecret

public SecretBundle getSecret(String secretIdentifier)

Get a specified secret from a given key vault.

Parameters:

secretIdentifier - The URL for the secret.

Returns:

the SecretBundle if successful.

getSecret

public SecretBundle getSecret(String vaultBaseUrl, String secretName)

Get a specified secret from a given key vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault

Returns:

the SecretBundle if successful.

getSecret

public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion)

Get a specified secret from a given key vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault
secretVersion - The version of the secret

Returns:

the SecretBundle if successful.

getSecretAsync

public ServiceFuture getSecretAsync(String secretIdentifier, final ServiceCallback serviceCallback)

Get a specified secret from a given key vault.

Parameters:

secretIdentifier - The URL for the secret.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getSecretAsync

public ServiceFuture getSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback serviceCallback)

Get a specified secret from a given key vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

getSecretAsync

public ServiceFuture getSecretAsync(String vaultBaseUrl, String secretName, String secretVersion, final ServiceCallback serviceCallback)

Get a specified secret from a given key vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault
secretVersion - The version of the secret
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

httpClient

public OkHttpClient httpClient()

Returns:

the HTTP client.

importCertificate

public CertificateBundle importCertificate(ImportCertificateRequest importCertificateRequest)

Imports a certificate into the specified vault.

Parameters:

importCertificateRequest - the grouped properties for importing a certificate request

Returns:

the CertificateBundle if successful.

importCertificateAsync

public ServiceFuture importCertificateAsync(ImportCertificateRequest importCertificateRequest, final ServiceCallback serviceCallback)

Imports a certificate into the specified vault.

Parameters:

importCertificateRequest - the grouped properties for importing a certificate request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

importKey

public KeyBundle importKey(ImportKeyRequest importKeyRequest)

Imports an externally created key, stores it, and returns key parameters and attributes to the client. 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. Authorization: requires the keys/import permission.

Parameters:

importKeyRequest - the grouped properties for importing a key request

Returns:

the KeyBundle if successful.

importKeyAsync

public ServiceFuture importKeyAsync(ImportKeyRequest importKeyRequest, final ServiceCallback serviceCallback)

Imports an externally created key, stores it, and returns key parameters and attributes to the client. 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. Authorization: requires the keys/import permission.

Parameters:

importKeyRequest - the grouped properties for importing a key request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listCertificateIssuers

public PagedList listCertificateIssuers(final String vaultBaseUrl)

List certificate issuers for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net

Returns:

the PagedList<CertificateIssuerItem> if successful.

listCertificateIssuers

public PagedList listCertificateIssuers(final String vaultBaseUrl, final Integer maxresults)

List certificate issuers for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.

Returns:

the PagedList<CertificateIssuerItem> if successful.

listCertificateIssuersAsync

public ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback)

List certificate issuers for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listCertificateIssuersAsync

public ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback)

List certificate issuers for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listCertificates

public PagedList listCertificates(final String vaultBaseUrl)

List certificates in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net

Returns:

the PagedList<CertificateItem> if successful.

listCertificates

public PagedList listCertificates(final String vaultBaseUrl, final Integer maxresults)

List certificates in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.

Returns:

the PagedList<CertificateItem> if successful.

listCertificatesAsync

public ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback)

List certificates in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listCertificatesAsync

public ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback)

List certificates in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listCertificateVersions

public PagedList listCertificateVersions(final String vaultBaseUrl, final String certificateName)

List the versions of a certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate

Returns:

the PagedList<CertificateItem> if successful.

listCertificateVersions

public PagedList listCertificateVersions(final String vaultBaseUrl, final String certificateName, final Integer maxresults)

List the versions of a certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.

Returns:

the PagedList<CertificateItem> if successful.

listCertificateVersionsAsync

public ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults, final ListOperationCallback serviceCallback)

List the versions of a certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listCertificateVersionsAsync

public ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final ListOperationCallback serviceCallback)

List the versions of a certificate.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
certificateName - The name of the certificate
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listKeys

public PagedList listKeys(final String vaultBaseUrl)

List keys in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net

Returns:

the PagedList<KeyItem> if successful.

listKeys

public PagedList listKeys(final String vaultBaseUrl, final Integer maxresults)

List keys in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.

Returns:

the PagedList<KeyItem> if successful.

listKeysAsync

public ServiceFuture> listKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback)

List keys in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listKeysAsync

public ServiceFuture> listKeysAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback)

List keys in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listKeyVersions

public PagedList listKeyVersions(final String vaultBaseUrl, final String keyName)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key

Returns:

the PagedList<KeyItem> if successful.

listKeyVersions

public PagedList listKeyVersions(final String vaultBaseUrl, final String keyName, final Integer maxresults)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.

Returns:

the PagedList<KeyItem> if successful.

listKeyVersionsAsync

public ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults, final ListOperationCallback serviceCallback)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listKeyVersionsAsync

public ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final ListOperationCallback serviceCallback)

Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyName - The name of the key
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listSecrets

public PagedList listSecrets(final String vaultBaseUrl)

List secrets in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net

Returns:

the PagedList<SecretItem> if successful.

listSecrets

public PagedList listSecrets(final String vaultBaseUrl, final Integer maxresults)

List secrets in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.

Returns:

the PagedList<SecretItem> if successful.

listSecretsAsync

public ServiceFuture> listSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback serviceCallback)

List secrets in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listSecretsAsync

public ServiceFuture> listSecretsAsync(final String vaultBaseUrl, final ListOperationCallback serviceCallback)

List secrets in the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listSecretVersions

public PagedList listSecretVersions(final String vaultBaseUrl, final String secretName)

List the versions of the specified secret.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault

Returns:

the PagedList<SecretItem> if successful.

listSecretVersions

public PagedList listSecretVersions(final String vaultBaseUrl, final String secretName, final Integer maxresults)

List the versions of the specified secret.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.

Returns:

the PagedList<SecretItem> if successful.

listSecretVersionsAsync

public ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults, final ListOperationCallback serviceCallback)

List the versions of the specified secret.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault
maxresults - Maximum number of results to return in a page. If not specified the service will return up to 25 results.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

listSecretVersionsAsync

public ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final ListOperationCallback serviceCallback)

List the versions of the specified secret.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
secretName - The name of the secret in the given vault
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

longRunningOperationRetryTimeout

public int longRunningOperationRetryTimeout()

Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.

Returns:

the longRunningOperationRetryTimeout value.

mergeCertificate

public CertificateBundle mergeCertificate(MergeCertificateRequest mergeCertificateRequest)

Merges a certificate or a certificate chain with a key pair existing on the server.

Parameters:

mergeCertificateRequest - the grouped properties for merging a certificate request

Returns:

the CertificateBundle if successful.

mergeCertificateAsync

public ServiceFuture mergeCertificateAsync(MergeCertificateRequest mergeCertificateRequest, final ServiceCallback serviceCallback)

Merges a certificate or a certificate chain with a key pair existing on the server.

Parameters:

mergeCertificateRequest - the grouped properties for merging a certificate request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

restClient

public RestClient restClient()

Returns:

the RestClient instance.

restoreKey

public KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup)

Restores the backup key in to a vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyBundleBackup - the backup blob associated with a key bundle

Returns:

the KeyBundle if successful.

restoreKeyAsync

public ServiceFuture restoreKeyAsync(String vaultBaseUrl, byte[] keyBundleBackup, final ServiceCallback serviceCallback)

Restores the backup key in to a vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
keyBundleBackup - the backup blob associated with a key bundle
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

retrofit

public Retrofit retrofit()

Returns:

the Retrofit instance.

serializerAdapter

public SerializerAdapter serializerAdapter()

Returns:

the adapter to a Jackson com.fasterxml.jackson.databind.ObjectMapper.

setCertificateContacts

public Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts)

Sets the certificate contacts for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
contacts - The contacts for the vault certificates.

Returns:

the Contacts if successful.

setCertificateContactsAsync

public ServiceFuture setCertificateContactsAsync(String vaultBaseUrl, Contacts contacts, final ServiceCallback serviceCallback)

Sets the certificate contacts for the specified vault.

Parameters:

vaultBaseUrl - The vault name, e.g. https://myvault.vault.azure.net
contacts - The contacts for the vault certificates.
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

setCertificateIssuer

public IssuerBundle setCertificateIssuer(SetCertificateIssuerRequest setCertificateIssuerRequest)

Sets the certificate contacts for the specified vault.

Parameters:

setCertificateIssuerRequest - the grouped properties for setting a certificate issuer request

Returns:

the IssuerBundle if successful.

setCertificateIssuerAsync

public ServiceFuture setCertificateIssuerAsync(SetCertificateIssuerRequest setCertificateIssuerRequest, final ServiceCallback serviceCallback)

Sets the certificate contacts for the specified vault.

Parameters:

setCertificateIssuerRequest - the grouped properties for setting a certificate issuer request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

setSecret

public SecretBundle setSecret(SetSecretRequest setSecretRequest)

Sets a secret in the specified vault.

Parameters:

setSecretRequest - the grouped properties for setting a secret request

Returns:

the SecretBundle if successful.

setSecretAsync

public ServiceFuture setSecretAsync(SetSecretRequest setSecretRequest, final ServiceCallback serviceCallback)

Sets a secret in the specified vault.

Parameters:

setSecretRequest - the grouped properties for setting a secret request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

sign

public KeyOperationResult sign(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value)

Creates a signature from a digest using the specified key.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the content to be signed

Returns:

the KeyOperationResult if successful.

signAsync

public ServiceFuture signAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback)

Creates a signature from a digest using the specified key.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the content to be signed
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

unwrapKey

public KeyOperationResult unwrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Unwraps a symmetric key using the specified key in the vault that has initially been used for wrapping the key.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the key to be unwrapped

Returns:

the KeyOperationResult if successful.

unwrapKeyAsync

public ServiceFuture unwrapKeyAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback)

Unwraps a symmetric key using the specified key in the vault that has initially been used for wrapping the key.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the key to be unwrapped
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

updateCertificate

public CertificateBundle updateCertificate(UpdateCertificateRequest updateCertificateRequest)

Updates the attributes associated with the specified certificate.

Parameters:

updateCertificateRequest - the grouped properties for updating a certificate request

Returns:

the CertificateBundle if successful.

updateCertificateAsync

public ServiceFuture updateCertificateAsync(UpdateCertificateRequest updateCertificateRequest, final ServiceCallback serviceCallback)

Updates the attributes associated with the specified certificate.

Parameters:

updateCertificateRequest - the grouped properties for updating a certificate request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

updateCertificateIssuer

public IssuerBundle updateCertificateIssuer(UpdateCertificateIssuerRequest updateCertificateIssuerRequest)

Updates the specified certificate issuer.

Parameters:

updateCertificateIssuerRequest - the grouped properties for updating a certificate issuer request

Returns:

the IssuerBundle if successful.

updateCertificateIssuerAsync

public ServiceFuture updateCertificateIssuerAsync(UpdateCertificateIssuerRequest updateCertificateIssuerRequest, final ServiceCallback serviceCallback)

Updates the specified certificate issuer.

Parameters:

updateCertificateIssuerRequest - the grouped properties for updating a certificate issuer request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

Throws:

IllegalArgumentException - thrown if callback is null

updateCertificateOperation

public CertificateOperation updateCertificateOperation(UpdateCertificateOperationRequest updateCertificateOperationRequest)

Updates a certificate operation.

Parameters:

updateCertificateOperationRequest - the grouped properties for updating a certificate operation request

Returns:

the CertificateOperation if successful.

updateCertificateOperationAsync

public ServiceFuture updateCertificateOperationAsync(UpdateCertificateOperationRequest updateCertificateOperationRequest, final ServiceCallback serviceCallback)

Updates a certificate operation.

Parameters:

updateCertificateOperationRequest - the grouped properties for updating a certificate operation request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

updateCertificatePolicy

public CertificatePolicy updateCertificatePolicy(UpdateCertificatePolicyRequest updateCertificatePolicyRequest)

Updates the policy for a certificate. Set appropriate members in the certificatePolicy that must be updated. Leave others as null.

Parameters:

updateCertificatePolicyRequest - the grouped properties for updating a certificate policy request

Returns:

the CertificatePolicy if successful.

updateCertificatePolicyAsync

public ServiceFuture updateCertificatePolicyAsync(UpdateCertificatePolicyRequest updateCertificatePolicyRequest, final ServiceCallback serviceCallback)

Updates the policy for a certificate. Set appropriate members in the certificatePolicy that must be updated. Leave others as null.

Parameters:

updateCertificatePolicyRequest - the grouped properties for updating a certificate policy request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

updateKey

public KeyBundle updateKey(UpdateKeyRequest updateKeyRequest)

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission.

Parameters:

updateKeyRequest - the grouped properties for updating a key request

Returns:

the KeyBundle if successful.

updateKeyAsync

public ServiceFuture updateKeyAsync(UpdateKeyRequest updateKeyRequest, final ServiceCallback serviceCallback)

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. The cryptographic material of a key itself cannot be changed. In order to perform this operation, the key must already exist in the Key Vault. Authorization: requires the keys/update permission.

Parameters:

updateKeyRequest - the grouped properties for updating a key request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

updateSecret

public SecretBundle updateSecret(UpdateSecretRequest updateSecretRequest)

Updates the attributes associated with a specified secret in a given key vault.

Parameters:

updateSecretRequest - the grouped properties for updating a secret request

Returns:

the SecretBundle if successful.

updateSecretAsync

public ServiceFuture updateSecretAsync(UpdateSecretRequest updateSecretRequest, final ServiceCallback serviceCallback)

Updates the attributes associated with a specified secret in a given key vault.

Parameters:

updateSecretRequest - the grouped properties for updating a secret request
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

userAgent

public String userAgent()

Gets the User-Agent header for the client.

Returns:

the user agent string.

verify

public KeyVerifyResult verify(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature)

Verifies a signature using the specified key.

Parameters:

keyIdentifier - The full key identifier
algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
digest - The digest used for signing
signature - The signature to be verified

Returns:

the KeyVerifyResult if successful.

verifyAsync

public ServiceFuture verifyAsync(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature, final ServiceCallback serviceCallback)

Verifies a signature using the specified key.

Parameters:

keyIdentifier - The full key identifier
algorithm - The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm.
digest - The digest used for signing
signature - The signature to be verified
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

withAcceptLanguage

public void withAcceptLanguage(String acceptLanguage)

Sets Gets or sets the preferred language for the response.

Parameters:

acceptLanguage - the acceptLanguage value.

withGenerateClientRequestId

public void withGenerateClientRequestId(boolean generateClientRequestId)

Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.

Parameters:

generateClientRequestId - the generateClientRequestId value.

withLongRunningOperationRetryTimeout

public void withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout)

Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.

Parameters:

longRunningOperationRetryTimeout - the longRunningOperationRetryTimeout value.

wrapKey

public KeyOperationResult wrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)

Wraps a symmetric key using the specified key.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the key to be wrapped

Returns:

the KeyOperationResult if successful.

wrapKeyAsync

public ServiceFuture wrapKeyAsync(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback serviceCallback)

Wraps a symmetric key using the specified key.

Parameters:

keyIdentifier - The full key identifier
algorithm - algorithm identifier
value - the key to be wrapped
serviceCallback - the async ServiceCallback to handle successful and failed responses.

Returns:

the ServiceFuture object

Applies to