Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Returns a random byte string that is cryptographically secure.
By default, the random byte string is generated in KMS. To generate the byte string in the CloudHSM cluster that is associated with a custom key store, specify the custom key store ID.
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.
Required permissions: kms:GenerateRandom (IAM policy)
Synopsis
- data GenerateRandom = GenerateRandom' {}
- newGenerateRandom :: GenerateRandom
- generateRandom_numberOfBytes :: Lens' GenerateRandom (Maybe Natural)
- generateRandom_customKeyStoreId :: Lens' GenerateRandom (Maybe Text)
- 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:
$sel:numberOfBytes:GenerateRandom'
, generateRandom_numberOfBytes
- The length of the byte string.
$sel:customKeyStoreId:GenerateRandom'
, generateRandom_customKeyStoreId
- Generates the random byte string in the CloudHSM cluster that is
associated with the specified
custom key store.
To find the ID of a custom key store, use the DescribeCustomKeyStores
operation.
Request Lenses
generateRandom_numberOfBytes :: Lens' GenerateRandom (Maybe Natural) Source #
The length of the byte string.
generateRandom_customKeyStoreId :: Lens' GenerateRandom (Maybe Text) Source #
Generates the random byte string in the CloudHSM cluster that is associated with the specified custom key store. To find the ID of a custom key store, use the DescribeCustomKeyStores operation.
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.