Key Management Service API, gRPC: SymmetricCryptoService.Encrypt
Encrypts given plaintext with the specified key.
gRPC request
rpc Encrypt (SymmetricEncryptRequest) returns (SymmetricEncryptResponse)
SymmetricEncryptRequest
{
"key_id": "string",
"version_id": "string",
"aad_context": "bytes",
"plaintext": "bytes"
}
Field |
Description |
key_id |
string Required field. ID of the symmetric KMS key to use for encryption. |
version_id |
string ID of the key version to encrypt plaintext with. |
aad_context |
bytes Additional authenticated data (AAD context), optional. |
plaintext |
bytes Required field. Plaintext to be encrypted. |
SymmetricEncryptResponse
{
"key_id": "string",
"version_id": "string",
"ciphertext": "bytes"
}
Field |
Description |
key_id |
string Required field. ID of the symmetric KMS key that was used for encryption. |
version_id |
string ID of the key version that was used for encryption. |
ciphertext |
bytes Resulting ciphertext. |