Key Management Service API, REST: SymmetricCrypto.Encrypt
Encrypts given plaintext with the specified key.
HTTP request
POST https://kms.yandex/kms/v1/keys/{keyId}:encrypt
Path parameters
Field |
Description |
keyId |
string Required field. ID of the symmetric KMS key to use for encryption. |
Body parameters
{
"versionId": "string",
"aadContext": "string",
"plaintext": "string"
}
Field |
Description |
versionId |
string ID of the key version to encrypt plaintext with. |
aadContext |
string (bytes) Additional authenticated data (AAD context), optional. |
plaintext |
string (bytes) Required field. Plaintext to be encrypted. |
Response
HTTP Code: 200 - OK
{
"keyId": "string",
"versionId": "string",
"ciphertext": "string"
}
Field |
Description |
keyId |
string Required field. ID of the symmetric KMS key that was used for encryption. |
versionId |
string ID of the key version that was used for encryption. |
ciphertext |
string (bytes) Resulting ciphertext. |