Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Документация
  • Блог
Проект Яндекса
© 2023 ООО «Яндекс.Облако»
Yandex Key Management Service
  • Начало работы
  • Управление доступом
  • Правила тарификации
    • Аутентификация в API
      • Overview
        • Overview
        • decrypt
        • encrypt
        • generateDataKey
        • reEncrypt
  • Вопросы и ответы
  • Обучающие курсы
  1. Справочник API
  2. REST (англ.)
  3. SymmetricCrypto
  4. encrypt

Key Management Service API, REST: SymmetricCrypto.encrypt

Статья создана
Yandex Cloud
  • HTTP request
  • Path parameters
  • Body parameters
  • Response

Encrypts given plaintext with the specified key.

HTTP requestHTTP request

POST https://kms.yandex/kms/v1/keys/{keyId}:encrypt

Path parametersPath parameters

Parameter Description
keyId

Required. ID of the symmetric KMS key to use for encryption.

The maximum string length in characters is 50.

Body parametersBody parameters

{
  "versionId": "string",
  "aadContext": "string",
  "plaintext": "string"
}
Field Description
versionId string

ID of the key version to encrypt plaintext with. Defaults to the primary version if not specified.

The maximum string length in characters is 50.

aadContext string (byte)

Additional authenticated data (AAD context), optional. If specified, this data will be required for decryption with the SymmetricDecryptRequest. Should be encoded with base64.

The maximum string length in characters is 8192.

plaintext string (byte)

Required. Plaintext to be encrypted. Should be encoded with base64.

The maximum string length in characters is 32768.

ResponseResponse

HTTP Code: 200 - OK

{
  "keyId": "string",
  "versionId": "string",
  "ciphertext": "string"
}
Field Description
keyId string

Required. ID of the symmetric KMS key that was used for encryption.

The maximum string length in characters is 50.

versionId string

ID of the key version that was used for encryption.

The maximum string length in characters is 50.

ciphertext string (byte)

Resulting ciphertext.

Была ли статья полезна?

Предыдущая
decrypt
Следующая
generateDataKey
Проект Яндекса
© 2023 ООО «Яндекс.Облако»
В этой статье:
  • HTTP request
  • Path parameters
  • Body parameters
  • Response