---
title: "POST /kms/keys/{resource_id}/encrypt"
method: POST
path: "/kms/keys/{resource_id}/encrypt"
tags: ["kms-key"]
---

# POST /kms/keys/{resource_id}/encrypt

`POST /kms/keys/{resource_id}/encrypt`

## Request

- Base URL: `https://secure.sakura.ad.jp/cloud/zone/is1a/api/cloud/1.1`
- URL: `https://secure.sakura.ad.jp/cloud/zone/is1a/api/cloud/1.1/kms/keys/{resource_id}/encrypt`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/sakura/apis/kms-secretmanager-cloudhsm-api/docs/kms/keys/:resource_id/encrypt/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `resource_id` string, required

## Request body

- WrappedEncryptionRequest
  - `Key` EncryptionRequest, required
    - `Plain` string, required: Base64 エンコードされた平文
    - `Algo` 'aes-256-gcm' | 'aes-256-cbc' | 'aes-256-kw': 暗号化アルゴリズム * `aes-256-gcm` - AES256-GCM（default） * `aes-256-cbc` - AES256-CBC * `aes-256-kw` - AES256-KW

## Response `200`

- WrappedKeyCipher
  - `Key` KeyCipher, required
    - `Cipher` string, required: Base64 エンコードされた暗号文
  - `is_ok` boolean, required

---

[API](https://skmtc.dev/sakura/apis/kms-secretmanager-cloudhsm-api.md) - [All operations](https://skmtc.dev/sakura/apis/kms-secretmanager-cloudhsm-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sakura/apis/kms-secretmanager-cloudhsm-api/revisions/9a535fabbdfa?raw)
