KeyVaultClient Class
- java.
lang. Object - com.
microsoft. azure. keyvault. KeyVaultClient
- com.
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
Constructor Details
KeyVaultClient
public KeyVaultClient(RestClient restClient)
Initializes an instance of KeyVaultClient client.
Parameters:
KeyVaultClient
public KeyVaultClient(ServiceClientCredentials credentials)
Initializes an instance of KeyVaultClient client.
Parameters:
Method Details
acceptLanguage
public String acceptLanguage()
Gets Gets or sets the preferred language for the response.
Returns:
apiVersion
public String apiVersion()
Gets Client Api Version.
Returns:
backupKey
public BackupKeyResult backupKey(String vaultBaseUrl, String keyName)
Requests that a backup of the specified key be downloaded to the client.
Parameters:
Returns:
backupKeyAsync
public ServiceFuture
Requests that a backup of the specified key be downloaded to the client.
Parameters:
Returns:
createCertificate
public CertificateOperation createCertificate(CreateCertificateRequest createCertificateRequest)
Creates a new certificate version. If this is the first version, the certificate resource is created.
Parameters:
Returns:
createCertificateAsync
public ServiceFuture
Creates a new certificate version. If this is the first version, the certificate resource is created.
Parameters:
Returns:
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:
Returns:
createKeyAsync
public ServiceFuture
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:
Returns:
decrypt
public KeyOperationResult decrypt(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)
Decrypts a single block of encrypted data.
Parameters:
Returns:
decryptAsync
public ServiceFuture
Decrypts a single block of encrypted data.
Parameters:
Returns:
deleteCertificate
public CertificateBundle deleteCertificate(String vaultBaseUrl, String certificateName)
Deletes a certificate from the specified vault.
Parameters:
Returns:
deleteCertificateAsync
public ServiceFuture
Deletes a certificate from the specified vault.
Parameters:
Returns:
deleteCertificateContacts
public Contacts deleteCertificateContacts(String vaultBaseUrl)
Deletes the certificate contacts for the specified vault.
Parameters:
Returns:
deleteCertificateContactsAsync
public ServiceFuture
Deletes the certificate contacts for the specified vault.
Parameters:
Returns:
deleteCertificateIssuer
public IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName)
Deletes the specified certificate issuer.
Parameters:
Returns:
deleteCertificateIssuerAsync
public ServiceFuture
Deletes the specified certificate issuer.
Parameters:
Returns:
deleteCertificateOperation
public CertificateOperation deleteCertificateOperation(String vaultBaseUrl, String certificateName)
Deletes the operation for a specified certificate.
Parameters:
Returns:
deleteCertificateOperationAsync
public ServiceFuture
Deletes the operation for a specified certificate.
Parameters:
Returns:
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:
Returns:
deleteKeyAsync
public ServiceFuture
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:
Returns:
deleteSecret
public SecretBundle deleteSecret(String vaultBaseUrl, String secretName)
Deletes a secret from the specified vault.
Parameters:
Returns:
deleteSecretAsync
public ServiceFuture
Deletes a secret from the specified vault.
Parameters:
Returns:
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:
Returns:
encryptAsync
public ServiceFuture
Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
Parameters:
Returns:
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:
getAzureClient
public AzureClient getAzureClient()
Gets the AzureClient used for long running operations.
Returns:
getCertificate
public CertificateBundle getCertificate(String certificateIdentifier)
Gets information about a specified certificate.
Parameters:
Returns:
getCertificate
public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName)
Gets information about a specified certificate.
Parameters:
Returns:
getCertificate
public CertificateBundle getCertificate(String vaultBaseUrl, String certificateName, String certificateVersion)
Gets information about a specified certificate.
Parameters:
Returns:
getCertificateAsync
public ServiceFuture
Gets information about a specified certificate.
Parameters:
Returns:
getCertificateAsync
public ServiceFuture
Gets information about a specified certificate.
Parameters:
Returns:
getCertificateAsync
public ServiceFuture
Gets information about a specified certificate.
Parameters:
Returns:
getCertificateContacts
public Contacts getCertificateContacts(String vaultBaseUrl)
Gets the certificate contacts for the specified vault.
Parameters:
Returns:
getCertificateContactsAsync
public ServiceFuture
Gets the certificate contacts for the specified vault.
Parameters:
Returns:
getCertificateIssuer
public IssuerBundle getCertificateIssuer(String vaultBaseUrl, String issuerName)
Gets the specified certificate issuer.
Parameters:
Returns:
getCertificateIssuerAsync
public ServiceFuture
Gets the specified certificate issuer.
Parameters:
Returns:
getCertificateOperation
public CertificateOperation getCertificateOperation(String vaultBaseUrl, String certificateName)
Gets the operation associated with a specified certificate.
Parameters:
Returns:
getCertificateOperationAsync
public ServiceFuture
Gets the operation associated with a specified certificate.
Parameters:
Returns:
getCertificatePolicy
public CertificatePolicy getCertificatePolicy(String vaultBaseUrl, String certificateName)
Gets the policy for a certificate.
Parameters:
Returns:
getCertificatePolicyAsync
public ServiceFuture
Gets the policy for a certificate.
Parameters:
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
getKeyAsync
public ServiceFuture
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:
Returns:
getKeyAsync
public ServiceFuture
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:
Returns:
getKeyAsync
public ServiceFuture
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:
Returns:
getPendingCertificateSigningRequest
public String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName)
Gets the pending certificate signing request response.
Parameters:
Returns:
getPendingCertificateSigningRequestAsync
public ServiceFuture
Gets the pending certificate signing request response.
Parameters:
Returns:
getSecret
public SecretBundle getSecret(String secretIdentifier)
Get a specified secret from a given key vault.
Parameters:
Returns:
getSecret
public SecretBundle getSecret(String vaultBaseUrl, String secretName)
Get a specified secret from a given key vault.
Parameters:
Returns:
getSecret
public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion)
Get a specified secret from a given key vault.
Parameters:
Returns:
getSecretAsync
public ServiceFuture
Get a specified secret from a given key vault.
Parameters:
Returns:
getSecretAsync
public ServiceFuture
Get a specified secret from a given key vault.
Parameters:
Returns:
getSecretAsync
public ServiceFuture
Get a specified secret from a given key vault.
Parameters:
Returns:
httpClient
public OkHttpClient httpClient()
Returns:
importCertificate
public CertificateBundle importCertificate(ImportCertificateRequest importCertificateRequest)
Imports a certificate into the specified vault.
Parameters:
Returns:
importCertificateAsync
public ServiceFuture
Imports a certificate into the specified vault.
Parameters:
Returns:
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:
Returns:
importKeyAsync
public ServiceFuture
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:
Returns:
listCertificateIssuers
public PagedList
List certificate issuers for the specified vault.
Parameters:
Returns:
listCertificateIssuers
public PagedList
List certificate issuers for the specified vault.
Parameters:
Returns:
listCertificateIssuersAsync
public ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback
List certificate issuers for the specified vault.
Parameters:
Returns:
listCertificateIssuersAsync
public ServiceFuture> listCertificateIssuersAsync(final String vaultBaseUrl, final ListOperationCallback
List certificate issuers for the specified vault.
Parameters:
Returns:
listCertificates
public PagedList
List certificates in the specified vault.
Parameters:
Returns:
listCertificates
public PagedList
List certificates in the specified vault.
Parameters:
Returns:
listCertificatesAsync
public ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback
List certificates in the specified vault.
Parameters:
Returns:
listCertificatesAsync
public ServiceFuture> listCertificatesAsync(final String vaultBaseUrl, final ListOperationCallback
List certificates in the specified vault.
Parameters:
Returns:
listCertificateVersions
public PagedList
List the versions of a certificate.
Parameters:
Returns:
listCertificateVersions
public PagedList
List the versions of a certificate.
Parameters:
Returns:
listCertificateVersionsAsync
public ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final Integer maxresults, final ListOperationCallback
List the versions of a certificate.
Parameters:
Returns:
listCertificateVersionsAsync
public ServiceFuture> listCertificateVersionsAsync(final String vaultBaseUrl, final String certificateName, final ListOperationCallback
List the versions of a certificate.
Parameters:
Returns:
listKeys
public PagedList
List keys in the specified vault.
Parameters:
Returns:
listKeys
public PagedList
List keys in the specified vault.
Parameters:
Returns:
listKeysAsync
public ServiceFuture> listKeysAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback
List keys in the specified vault.
Parameters:
Returns:
listKeysAsync
public ServiceFuture> listKeysAsync(final String vaultBaseUrl, final ListOperationCallback
List keys in the specified vault.
Parameters:
Returns:
listKeyVersions
public PagedList
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:
Returns:
listKeyVersions
public PagedList
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:
Returns:
listKeyVersionsAsync
public ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final Integer maxresults, final ListOperationCallback
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:
Returns:
listKeyVersionsAsync
public ServiceFuture> listKeyVersionsAsync(final String vaultBaseUrl, final String keyName, final ListOperationCallback
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:
Returns:
listSecrets
public PagedList
List secrets in the specified vault.
Parameters:
Returns:
listSecrets
public PagedList
List secrets in the specified vault.
Parameters:
Returns:
listSecretsAsync
public ServiceFuture> listSecretsAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback
List secrets in the specified vault.
Parameters:
Returns:
listSecretsAsync
public ServiceFuture> listSecretsAsync(final String vaultBaseUrl, final ListOperationCallback
List secrets in the specified vault.
Parameters:
Returns:
listSecretVersions
public PagedList
List the versions of the specified secret.
Parameters:
Returns:
listSecretVersions
public PagedList
List the versions of the specified secret.
Parameters:
Returns:
listSecretVersionsAsync
public ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final Integer maxresults, final ListOperationCallback
List the versions of the specified secret.
Parameters:
Returns:
listSecretVersionsAsync
public ServiceFuture> listSecretVersionsAsync(final String vaultBaseUrl, final String secretName, final ListOperationCallback
List the versions of the specified secret.
Parameters:
Returns:
longRunningOperationRetryTimeout
public int longRunningOperationRetryTimeout()
Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
Returns:
mergeCertificate
public CertificateBundle mergeCertificate(MergeCertificateRequest mergeCertificateRequest)
Merges a certificate or a certificate chain with a key pair existing on the server.
Parameters:
Returns:
mergeCertificateAsync
public ServiceFuture
Merges a certificate or a certificate chain with a key pair existing on the server.
Parameters:
Returns:
restClient
public RestClient restClient()
Returns:
restoreKey
public KeyBundle restoreKey(String vaultBaseUrl, byte[] keyBundleBackup)
Restores the backup key in to a vault.
Parameters:
Returns:
restoreKeyAsync
public ServiceFuture
Restores the backup key in to a vault.
Parameters:
Returns:
retrofit
public Retrofit retrofit()
Returns:
serializerAdapter
public SerializerAdapter serializerAdapter()
Returns:
setCertificateContacts
public Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts)
Sets the certificate contacts for the specified vault.
Parameters:
Returns:
setCertificateContactsAsync
public ServiceFuture
Sets the certificate contacts for the specified vault.
Parameters:
Returns:
setCertificateIssuer
public IssuerBundle setCertificateIssuer(SetCertificateIssuerRequest setCertificateIssuerRequest)
Sets the certificate contacts for the specified vault.
Parameters:
Returns:
setCertificateIssuerAsync
public ServiceFuture
Sets the certificate contacts for the specified vault.
Parameters:
Returns:
setSecret
public SecretBundle setSecret(SetSecretRequest setSecretRequest)
Sets a secret in the specified vault.
Parameters:
Returns:
setSecretAsync
public ServiceFuture
Sets a secret in the specified vault.
Parameters:
Returns:
sign
public KeyOperationResult sign(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] value)
Creates a signature from a digest using the specified key.
Parameters:
Returns:
signAsync
public ServiceFuture
Creates a signature from a digest using the specified key.
Parameters:
Returns:
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:
Returns:
unwrapKeyAsync
public ServiceFuture
Unwraps a symmetric key using the specified key in the vault that has initially been used for wrapping the key.
Parameters:
Returns:
updateCertificate
public CertificateBundle updateCertificate(UpdateCertificateRequest updateCertificateRequest)
Updates the attributes associated with the specified certificate.
Parameters:
Returns:
updateCertificateAsync
public ServiceFuture
Updates the attributes associated with the specified certificate.
Parameters:
Returns:
updateCertificateIssuer
public IssuerBundle updateCertificateIssuer(UpdateCertificateIssuerRequest updateCertificateIssuerRequest)
Updates the specified certificate issuer.
Parameters:
Returns:
updateCertificateIssuerAsync
public ServiceFuture
Updates the specified certificate issuer.
Parameters:
Returns:
Throws:
updateCertificateOperation
public CertificateOperation updateCertificateOperation(UpdateCertificateOperationRequest updateCertificateOperationRequest)
Updates a certificate operation.
Parameters:
Returns:
updateCertificateOperationAsync
public ServiceFuture
Updates a certificate operation.
Parameters:
Returns:
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:
Returns:
updateCertificatePolicyAsync
public ServiceFuture
Updates the policy for a certificate. Set appropriate members in the certificatePolicy that must be updated. Leave others as null.
Parameters:
Returns:
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:
Returns:
updateKeyAsync
public ServiceFuture
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:
Returns:
updateSecret
public SecretBundle updateSecret(UpdateSecretRequest updateSecretRequest)
Updates the attributes associated with a specified secret in a given key vault.
Parameters:
Returns:
updateSecretAsync
public ServiceFuture
Updates the attributes associated with a specified secret in a given key vault.
Parameters:
Returns:
userAgent
public String userAgent()
Gets the User-Agent header for the client.
Returns:
verify
public KeyVerifyResult verify(String keyIdentifier, JsonWebKeySignatureAlgorithm algorithm, byte[] digest, byte[] signature)
Verifies a signature using the specified key.
Parameters:
Returns:
verifyAsync
public ServiceFuture
Verifies a signature using the specified key.
Parameters:
Returns:
withAcceptLanguage
public void withAcceptLanguage(String acceptLanguage)
Sets Gets or sets the preferred language for the response.
Parameters:
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:
withLongRunningOperationRetryTimeout
public void withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout)
Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
Parameters:
wrapKey
public KeyOperationResult wrapKey(String keyIdentifier, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value)
Wraps a symmetric key using the specified key.
Parameters:
Returns:
wrapKeyAsync
public ServiceFuture
Wraps a symmetric key using the specified key.
Parameters:
Returns:
Applies to
Azure SDK for Java