Key Management Service API, gRPC: SymmetricCryptoService.Encrypt
Encrypts given plaintext with the specified key.
gRPC request
rpc Encrypt (SymmetricEncryptRequest) returns (SymmetricEncryptResponse)
SymmetricEncryptRequest
{
"keyId": "string",
"versionId": "string",
"aadContext": "bytes",
"plaintext": "bytes"
}
Field |
Description |
keyId |
string Required field. ID of the symmetric KMS key to use for encryption. |
versionId |
string ID of the key version to encrypt plaintext with. |
aadContext |
bytes Additional authenticated data (AAD context), optional. |
plaintext |
bytes Required field. Plaintext to be encrypted. |
SymmetricEncryptResponse
{
"keyId": "string",
"versionId": "string",
"ciphertext": "bytes"
}
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 |
bytes Resulting ciphertext. |