Interface AzureKeyVaultKeysClient


@RegisterRestClient(configKey="azure-key-vault-keys") public interface AzureKeyVaultKeysClient

REST client for Azure Key Vault.

To use this client, the application.properties must have the definition of the following properties:

  • quarkus.rest-client.azure-key-vault-keys.url must be set with the URL of Azure Key Vault;
  • azure-key-vault-keys.api-version must be 7.4;
  • azure-key-vault-keys.get-keys.maxresults must be set with the maximum number of items returned in a page by get operations.
Author:
Antonio Tarricone
  • Method Details

    • createKey

      @Path("/keys/{keyName}/create") @POST @Consumes("application/json") @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version", value="${azure-key-vault-keys.api-version}") KeyBundle createKey(@NotBody String accessToken, @PathParam("keyName") String keyName, KeyCreateParameters keyCreateParameters)

      Creates a new key, stores it, then returns key parameters and attributes to the client.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name for the new key. Regex pattern: ^[0-9a-zA-Z-]+$
      keyCreateParameters - KeyCreateParameters
      Returns:
      KeyBundle
      See Also:
    • getKeys

      @Path("/keys") @GET @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="maxresults",value="${azure-key-vault-keys.get-keys.maxresults}") @ClientQueryParam(name="api-version",value="${azure-key-vault-keys.api-version}") KeyListResult getKeys(@NotBody String accessToken)

      List keys in the specified vault.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      Returns:
      KeyListResult
      See Also:
    • getKeys

      @Path("/keys") @GET @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version",value="${azure-key-vault-keys.api-version}") @ClientQueryParam(name="maxresults",value="${azure-key-vault-keys.get-keys.maxresults}") KeyListResult getKeys(@NotBody String accessToken, @QueryParam("$skiptoken") String skiptoken)

      List keys in the specified vault.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      skiptoken - Token to handle paging.
      Returns:
      KeyListResult
      See Also:
    • getKey

      @Path("/keys/{keyName}/{keyVersion}") @GET @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version", value="${azure-key-vault-keys.api-version}") KeyBundle getKey(@NotBody String accessToken, @PathParam("keyName") String keyName, @PathParam("keyVersion") String keyVersion)

      Gets the public part of a stored key.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key to get.
      keyVersion - The version of the key.
      Returns:
      KeyBundle
      See Also:
    • getKeyVersions

      @Path("/keys/{keyName}/versions") @GET @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="maxresults",value="${azure-key-vault-keys.get-key-version.maxresults}") @ClientQueryParam(name="api-version",value="${azure-key-vault-keys.api-version}") KeyListResult getKeyVersions(@NotBody String accessToken, @PathParam("keyName") String keyName)

      Retrieves a list of individual key versions with the same key name.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key.
      Returns:
      KeyListResult
      See Also:
    • getKeyVersions

      @Path("/keys/{keyName}/versions") @GET @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version",value="${azure-key-vault-keys.api-version}") @ClientQueryParam(name="maxresults",value="${azure-key-vault-keys.get-keys.maxresults}") KeyListResult getKeyVersions(@NotBody String accessToken, @PathParam("keyName") String keyName, @QueryParam("$skiptoken") String skiptoken)

      Retrieves a list of individual key versions with the same key name.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key.
      skiptoken - Token to handle paging.
      Returns:
      KeyListResult
      See Also:
    • sign

      @Path("/keys/{keyName}/{keyVersion}/sign") @POST @Consumes("application/json") @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version", value="${azure-key-vault-keys.api-version}") KeyOperationResult sign(@NotBody String accessToken, @PathParam("keyName") String keyName, @PathParam("keyVersion") String keyVersion, KeySignParameters keySignParameters)

      Creates a signature from a digest using the specified key.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key.
      keyVersion - The version of the key.
      keySignParameters - KeySignParameters
      Returns:
      KeyOperationResult
      See Also:
    • verify

      @Path("/keys/{keyName}/{keyVersion}/verify") @POST @Consumes("application/json") @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version", value="${azure-key-vault-keys.api-version}") KeyVerifyResult verify(@NotBody String accessToken, @PathParam("keyName") String keyName, @PathParam("keyVersion") String keyVersion, KeyVerifyParameters keyVerifyParameters)

      Verifies a signature using a specified key.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key.
      keyVersion - The version of the key.
      keyVerifyParameters - KeyVerifyParameters
      Returns:
      KeyVerifyResult
      See Also:
    • encrypt

      @Path("/keys/{keyName}/{keyVersion}/encrypt") @POST @Consumes("application/json") @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version", value="${azure-key-vault-keys.api-version}") KeyOperationResult encrypt(@NotBody String accessToken, @PathParam("keyName") String keyName, @PathParam("keyVersion") String keyVersion, KeyOperationParameters keyOperationParameters)

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

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key.
      keyVersion - The version of the key.
      keyOperationParameters - KeyOperationParameters
      Returns:
      KeyOperationResult
      See Also:
    • decrypt

      @Path("/keys/{keyName}/{keyVersion}/decrypt") @POST @Consumes("application/json") @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version", value="${azure-key-vault-keys.api-version}") KeyOperationResult decrypt(@NotBody String accessToken, @PathParam("keyName") String keyName, @PathParam("keyVersion") String keyVersion, KeyOperationParameters keyOperationParameters)

      Decrypts a single block of encrypted data.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key.
      keyVersion - The version of the key.
      keyOperationParameters - KeyOperationParameters
      Returns:
      KeyOperationResult
      See Also:
    • deleteKey

      @Path("/keys/{keyName}") @GET @Produces("application/json") @ClientHeaderParam(name="Authorization", value="Bearer {accessToken}") @ClientQueryParam(name="api-version", value="${azure-key-vault-keys.api-version}") DeletedKeyBundle deleteKey(@NotBody String accessToken, @PathParam("keyName") String keyName)

      Deletes a key of any type from storage in Azure Key Vault.

      Parameters:
      accessToken - The value of access token got by Microsoft Entra ID.
      keyName - The name of the key to delete.
      Returns:
      DeletedKeyBundle
      See Also: