Amazon KMS · Arazzo Workflow

Amazon KMS Generate and Recover Data Key

Version 1.0.0

Generate a data key, then decrypt its encrypted form to recover the plaintext key.

1 workflow 1 source API 1 provider
View Spec View on GitHub CryptographyData ProtectionEncryptionKey ManagementSecurityArazzoWorkflows

Provider

amazon-kms

Workflows

generate-and-recover-data-key
Generate a data key then decrypt the encrypted copy to recover it.
Generates a symmetric data key under a KMS key and decrypts the returned encrypted data key to prove the stored ciphertext can be turned back into a usable plaintext key.
2 steps inputs: KeyId, KeySpec outputs: encryptedDataKey, recoveredPlaintext
1
generateDataKey
GenerateDataKey
Generate a unique symmetric data key under the KMS key, returning both the plaintext key and its encrypted form.
2
recoverDataKey
Decrypt
Decrypt the encrypted data key returned by generation to recover the original plaintext data key.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Amazon KMS Generate and Recover Data Key
  summary: Generate a data key, then decrypt its encrypted form to recover the plaintext key.
  description: >-
    Supports the data-key lifecycle where an application stores only the
    encrypted data key alongside its ciphertext and re-derives the plaintext key
    on demand. The workflow generates a symmetric data key, then immediately
    decrypts the returned encrypted data key to confirm it can be recovered. The
    CiphertextBlob from generation is chained into the decrypt call. Each step
    spells out its request inline, including the AWS JSON protocol X-Amz-Target
    header, so the flow can be read and executed without opening the underlying
    OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: kmsApi
  url: ../openapi/amazon-kms-openapi.yml
  type: openapi
workflows:
- workflowId: generate-and-recover-data-key
  summary: Generate a data key then decrypt the encrypted copy to recover it.
  description: >-
    Generates a symmetric data key under a KMS key and decrypts the returned
    encrypted data key to prove the stored ciphertext can be turned back into a
    usable plaintext key.
  inputs:
    type: object
    required:
    - KeyId
    properties:
      KeyId:
        type: string
        description: Identifies the KMS key that protects the data key.
      KeySpec:
        type: string
        description: The length of the data key to generate (e.g. AES_256).
  steps:
  - stepId: generateDataKey
    description: >-
      Generate a unique symmetric data key under the KMS key, returning both the
      plaintext key and its encrypted form.
    operationId: GenerateDataKey
    parameters:
    - name: KeyId
      in: path
      value: $inputs.KeyId
    - name: X-Amz-Target
      in: header
      value: TrentService.GenerateDataKey
    requestBody:
      contentType: application/x-amz-json-1.1
      payload:
        KeyId: $inputs.KeyId
        KeySpec: $inputs.KeySpec
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      encryptedDataKey: $response.body#/CiphertextBlob
      plaintextDataKey: $response.body#/Plaintext
  - stepId: recoverDataKey
    description: >-
      Decrypt the encrypted data key returned by generation to recover the
      original plaintext data key.
    operationId: Decrypt
    parameters:
    - name: X-Amz-Target
      in: header
      value: TrentService.Decrypt
    requestBody:
      contentType: application/x-amz-json-1.1
      payload:
        KeyId: $inputs.KeyId
        CiphertextBlob: $steps.generateDataKey.outputs.encryptedDataKey
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      recoveredPlaintext: $response.body#/Plaintext
  outputs:
    encryptedDataKey: $steps.generateDataKey.outputs.encryptedDataKey
    recoveredPlaintext: $steps.recoverDataKey.outputs.recoveredPlaintext

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/amazon-kms-data-key-generate-and-decrypt-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.