Full name: projects.locations.generateRandomBytes
Generate random bytes using the Cloud KMS randomness source in the provided location.
HTTP request
POST https://cloudkms.googleapis.com/v1/{location=projects/*/locations/*}:generateRandomBytes
The URLs use gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
location
|
The project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1". |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{
"lengthBytes"
:
integer
,
"protectionLevel"
:
enum (
|
| Fields | |
|---|---|
lengthBytes
|
The length in bytes of the amount of randomness to retrieve. Minimum 8 bytes, maximum 1024 bytes. |
protectionLevel
|
The |
Response body
Response message for KeyManagementService.GenerateRandomBytes
.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "data" : string , "dataCrc32c" : string } |
| Fields | |
|---|---|
data
|
The generated data. A base64-encoded string. |
dataCrc32c
|
Integrity verification field. A CRC32C checksum of the returned |
Authorization scopes
Requires one of the following OAuth scopes:
-
https://www.googleapis.com/auth/cloudkms -
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview .

