The RandomGenerator class / security.RandomGenerator methods |
Creates a random base64 string.
security.RandomGenerator.CreateRandomString( size INTEGER ) RETURNING result STRING
Generates a random binary data of size bytes long and returns it in a STRING encoded in a Base64 form.
The size must be greater than 0.
Use this function when randomness is required, such as in xml.CryptoKey.deriveKey() or security.Digest.CreateDigestString().
This method is based on openssl, using /dev/random on Unix and CryptGenRandom() on Microsoft Windows, which are following CSPRNG specifications.
In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).