This topic shows you how to retrieve random bytes from the random number generator in Cloud HSM.
Before you begin
- Grant the
cloudkms.locations.generateRandomBytespermission in the cloud location(s) where your service will be generating random bytes. You can learn about permissions in Cloud Key Management Service at Permissions and roles.
Generating random bytes
C#
To run this code, first set up a C# development environment and install the Cloud KMS C# SDK.