> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# nebius kms symmetric-crypto generate-data-key

## Name

`nebius kms symmetric-crypto generate-data-key`

Generates a new symmetric data encryption key (not a KMS key) and returns\

the generated key as plaintext and as ciphertext encrypted with the specified symmetric KMS key.

## Synopsis

```
nebius kms symmetric-crypto generate-data-key
  --aad-context
  --data-key-spec [required]
  --key-id [required]
  --skip-plaintext
```

## Examples

**Generate a data key**

```
nebius kms symmetric-crypto generate-data-key \
  --key-id <key_ID> \
  --data-key-spec aes_256 \
  --aad-context <AAD_context_Base64>
```

## Options

`--aad-context` (bytesBase64)

Additional authenticated data (AAD context), optional.\

If specified, this data will be required for decryption with the \[SymmetricDecryptRequest].\

Should be encoded with base64.

`--data-key-spec` (string)* \[required]*

Encryption algorithm and key length for the generated data key.

A value must be one of:

<ul>
  <li>
    `aes_128`
  </li>

  <li>
    `aes_256`
  </li>
</ul>

`--key-id` (string)* \[required]*

ID of the symmetric KMS key that the generated data key should be encrypted with.

`--skip-plaintext` (bool)

If `true`, the method won't return the data key as plaintext.\

Default value is `false`.

## Global Options

`-h, --help` (bool)

Show this message.

`-p, --profile` (string)

Set a profile for interacting with the cloud.

`--format` (string)

Output format. Supported values: yaml|json|jsonpath|table|text.

`-f, --file` (string)

Input file. For 'update' commands automatically set --full=true.

`-c, --config` (string)

Provide path to config file.

`--debug` (bool)

Write debug logs to stderr. Commands save debug logs in the config directory under logs/, except help and shell completion.

`-I, --impersonate-service-account-id` (string)

Impersonate into the service account and use its token for a command.

`--color` (bool)

Enable colored output.

`--no-browser` (bool)

Do not open browser automatically on auth.

`--insecure` (bool)

Disable transport security.

`--auth-timeout` (duration: 2h30m10s)

Set the timeout for the request including authentication process, default is 15m0s.

`--per-retry-timeout` (duration: 2h30m10s)

Set the timeout for each retry attempt, default is 20s.

`--retries` (uint)

Set the number of retry attempts, 1 is disable retries, default is 3.

`--timeout` (duration: 2h30m10s)

Set the timeout for the main request, default is 1m0s.

`--no-check-update` (bool)

Suppress check for updates.

`--no-progress` (bool)

Suppress progress indicators and spinners.

**Input argument JSON Schema**

> [tab] Full
>
> ```json theme={null}
> {                        
>   "aad_context": bytes,   // [sensitive]
>                           // Additional authenticated data (AAD context), optional.
>                           // If specified, this data will be required for decryption with the [SymmetricDecryptRequest].
>                           // Should be encoded with base64.
>   "data_key_spec": enum(               // [required]
>                                        // Encryption algorithm and key length for the generated data key.
>     "SYMMETRIC_ALGORITHM_UNSPECIFIED",
>     "AES_128",                         // Deprecated. It is impossible to create new keys with this algorithm.
>                                        // AES algorithm with 128-bit keys.
>     "AES_256"                          // AES algorithm with 256-bit keys.
>   ),
>   "key_id": string,       // [required]
>                           // ID of the symmetric KMS key that the generated data key should be encrypted with.
>   "skip_plaintext": bool  // If `true`, the method won't return the data key as plaintext.
>                           // Default value is `false`.
> }
> ```

> [tab] CopyPaste Friendly
>
> ```json theme={null}
> nebius kms symmetric-crypto generate-data-key '
> {                                                                       
>   "aad_context": "",                                                    
>   "data_key_spec": "symmetric_algorithm_unspecified"|"aes_128"|"aes_256",
>   "key_id": "",                                                         
>   "skip_plaintext": false                                               
> }
> '
> ```

*Auto generated on 23-Nov-2026*
