Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Returns a random byte string that is cryptographically secure.
You must use the NumberOfBytes
parameter to specify the length of the
random byte string. There is no default value for string length.
By default, the random byte string is generated in KMS. To generate the
byte string in the CloudHSM cluster associated with an CloudHSM key
store, use the CustomKeyStoreId
parameter.
Applications in Amazon Web Services Nitro Enclaves can call this operation by using the Amazon Web Services Nitro Enclaves Development Kit. For information about the supporting parameters, see How Amazon Web Services Nitro Enclaves use KMS in the Key Management Service Developer Guide.
For more information about entropy and random number generation, see Key Management Service Cryptographic Details.
Cross-account use: Not applicable. GenerateRandom
does not use any
account-specific resources, such as KMS keys.
Required permissions: kms:GenerateRandom (IAM policy)
Synopsis
- data GenerateRandom = GenerateRandom' {}
- newGenerateRandom :: GenerateRandom
- generateRandom_customKeyStoreId :: Lens' GenerateRandom (Maybe Text)
- generateRandom_numberOfBytes :: Lens' GenerateRandom (Maybe Natural)
- data GenerateRandomResponse = GenerateRandomResponse' {}
- newGenerateRandomResponse :: Int -> GenerateRandomResponse
- generateRandomResponse_plaintext :: Lens' GenerateRandomResponse (Maybe ByteString)
- generateRandomResponse_httpStatus :: Lens' GenerateRandomResponse Int
Creating a Request
data GenerateRandom Source #
See: newGenerateRandom
smart constructor.
GenerateRandom' | |
|
Instances
newGenerateRandom :: GenerateRandom Source #
Create a value of GenerateRandom
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
GenerateRandom
, generateRandom_customKeyStoreId
- Generates the random byte string in the CloudHSM cluster that is
associated with the specified CloudHSM key store. To find the ID of a
custom key store, use the DescribeCustomKeyStores operation.
External key store IDs are not valid for this parameter. If you specify
the ID of an external key store, GenerateRandom
throws an
UnsupportedOperationException
.
$sel:numberOfBytes:GenerateRandom'
, generateRandom_numberOfBytes
- The length of the random byte string. This parameter is required.
Request Lenses
generateRandom_customKeyStoreId :: Lens' GenerateRandom (Maybe Text) Source #
Generates the random byte string in the CloudHSM cluster that is associated with the specified CloudHSM key store. To find the ID of a custom key store, use the DescribeCustomKeyStores operation.
External key store IDs are not valid for this parameter. If you specify
the ID of an external key store, GenerateRandom
throws an
UnsupportedOperationException
.
generateRandom_numberOfBytes :: Lens' GenerateRandom (Maybe Natural) Source #
The length of the random byte string. This parameter is required.
Destructuring the Response
data GenerateRandomResponse Source #
See: newGenerateRandomResponse
smart constructor.
Instances
newGenerateRandomResponse Source #
Create a value of GenerateRandomResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:plaintext:GenerateRandomResponse'
, generateRandomResponse_plaintext
- The random byte string. When you use the HTTP API or the Amazon Web
Services CLI, the value is Base64-encoded. Otherwise, it is not
Base64-encoded.--
-- Note: This Lens
automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens
accepts and returns only raw unencoded data.
$sel:httpStatus:GenerateRandomResponse'
, generateRandomResponse_httpStatus
- The response's http status code.
Response Lenses
generateRandomResponse_plaintext :: Lens' GenerateRandomResponse (Maybe ByteString) Source #
The random byte string. When you use the HTTP API or the Amazon Web
Services CLI, the value is Base64-encoded. Otherwise, it is not
Base64-encoded.--
-- Note: This Lens
automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens
accepts and returns only raw unencoded data.
generateRandomResponse_httpStatus :: Lens' GenerateRandomResponse Int Source #
The response's http status code.