libZSservicesZSamazonka-kmsZSamazonka-kms
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.KMS.GenerateRandom

Description

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

Creating a Request

data GenerateRandom Source #

See: newGenerateRandom smart constructor.

Constructors

GenerateRandom' 

Fields

Instances

Instances details
Eq GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

Read GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

Show GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

Generic GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

Associated Types

type Rep GenerateRandom :: Type -> Type #

NFData GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

Methods

rnf :: GenerateRandom -> () #

Hashable GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

ToJSON GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

AWSRequest GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

Associated Types

type AWSResponse GenerateRandom #

ToHeaders GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

ToPath GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

ToQuery GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

type Rep GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

type Rep GenerateRandom = D1 ('MetaData "GenerateRandom" "Amazonka.KMS.GenerateRandom" "libZSservicesZSamazonka-kmsZSamazonka-kms" 'False) (C1 ('MetaCons "GenerateRandom'" 'PrefixI 'True) (S1 ('MetaSel ('Just "numberOfBytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "customKeyStoreId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))
type AWSResponse GenerateRandom Source # 
Instance details

Defined in Amazonka.KMS.GenerateRandom

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_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.

Constructors

GenerateRandomResponse' 

Fields

  • plaintext :: Maybe (Sensitive Base64)

    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.

  • httpStatus :: Int

    The response's http status code.

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.