| 1 | |||
| 2 | package Paws::KMS::Encrypt; | ||
| 3 | use Moose; | ||
| 4 | has EncryptionAlgorithm => (is => 'ro', isa => 'Str'); | ||
| 5 | has EncryptionContext => (is => 'ro', isa => 'Paws::KMS::EncryptionContextType'); | ||
| 6 | has GrantTokens => (is => 'ro', isa => 'ArrayRef[Str|Undef]'); | ||
| 7 | has KeyId => (is => 'ro', isa => 'Str', required => 1); | ||
| 8 | has Plaintext => (is => 'ro', isa => 'Str', required => 1); | ||
| 9 | |||
| 10 | use MooseX::ClassAttribute; | ||
| 11 | |||
| 12 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'Encrypt'); | ||
| 13 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::KMS::EncryptResponse'); | ||
| 14 | class_has _result_key => (isa => 'Str', is => 'ro'); | ||
| 15 | 1; | ||
| 16 | |||
| 17 | ### main pod documentation begin ### | ||
| 18 | |||
| 19 | =head1 NAME | ||
| 20 | |||
| 21 | Paws::KMS::Encrypt - Arguments for method Encrypt on L<Paws::KMS> | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | This class represents the parameters used for calling the method Encrypt on the | ||
| 26 | L<AWS Key Management Service|Paws::KMS> service. Use the attributes of this class | ||
| 27 | as arguments to method Encrypt. | ||
| 28 | |||
| 29 | You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to Encrypt. | ||
| 30 | |||
| 31 | =head1 SYNOPSIS | ||
| 32 | |||
| 33 | my $kms = Paws->service('KMS'); | ||
| 34 | # To encrypt data | ||
| 35 | # The following example encrypts data with the specified customer master key | ||
| 36 | # (CMK). | ||
| 37 | my $EncryptResponse = $kms->Encrypt( | ||
| 38 | 'KeyId' => '1234abcd-12ab-34cd-56ef-1234567890ab', | ||
| 39 | 'Plaintext' => '<binary data>' | ||
| 40 | ); | ||
| 41 | |||
| 42 | # Results: | ||
| 43 | my $CiphertextBlob = $EncryptResponse->CiphertextBlob; | ||
| 44 | my $KeyId = $EncryptResponse->KeyId; | ||
| 45 | |||
| 46 | # Returns a L<Paws::KMS::EncryptResponse> object. | ||
| 47 | |||
| 48 | Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. | ||
| 49 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/kms/Encrypt> | ||
| 50 | |||
| 51 | =head1 ATTRIBUTES | ||
| 52 | |||
| 53 | |||
| 54 | =head2 EncryptionAlgorithm => Str | ||
| 55 | |||
| 56 | Specifies the encryption algorithm that AWS KMS will use to encrypt the | ||
| 57 | plaintext message. The algorithm must be compatible with the CMK that | ||
| 58 | you specify. | ||
| 59 | |||
| 60 | This parameter is required only for asymmetric CMKs. The default value, | ||
| 61 | C<SYMMETRIC_DEFAULT>, is the algorithm used for symmetric CMKs. If you | ||
| 62 | are using an asymmetric CMK, we recommend RSAES_OAEP_SHA_256. | ||
| 63 | |||
| 64 | Valid values are: C<"SYMMETRIC_DEFAULT">, C<"RSAES_OAEP_SHA_1">, C<"RSAES_OAEP_SHA_256"> | ||
| 65 | |||
| 66 | =head2 EncryptionContext => L<Paws::KMS::EncryptionContextType> | ||
| 67 | |||
| 68 | Specifies the encryption context that will be used to encrypt the data. | ||
| 69 | An encryption context is valid only for cryptographic operations | ||
| 70 | (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) | ||
| 71 | with a symmetric CMK. The standard asymmetric encryption algorithms | ||
| 72 | that AWS KMS uses do not support an encryption context. | ||
| 73 | |||
| 74 | An I<encryption context> is a collection of non-secret key-value pairs | ||
| 75 | that represents additional authenticated data. When you use an | ||
| 76 | encryption context to encrypt data, you must specify the same (an exact | ||
| 77 | case-sensitive match) encryption context to decrypt the data. An | ||
| 78 | encryption context is optional when encrypting with a symmetric CMK, | ||
| 79 | but it is highly recommended. | ||
| 80 | |||
| 81 | For more information, see Encryption Context | ||
| 82 | (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) | ||
| 83 | in the I<AWS Key Management Service Developer Guide>. | ||
| 84 | |||
| 85 | |||
| 86 | |||
| 87 | =head2 GrantTokens => ArrayRef[Str|Undef] | ||
| 88 | |||
| 89 | A list of grant tokens. | ||
| 90 | |||
| 91 | Use a grant token when your permission to call this operation comes | ||
| 92 | from a new grant that has not yet achieved I<eventual consistency>. For | ||
| 93 | more information, see Grant token | ||
| 94 | (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) | ||
| 95 | in the I<AWS Key Management Service Developer Guide>. | ||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | =head2 B<REQUIRED> KeyId => Str | ||
| 100 | |||
| 101 | Identifies the customer master key (CMK) to use in the encryption | ||
| 102 | operation. | ||
| 103 | |||
| 104 | To specify a CMK, use its key ID, key ARN, alias name, or alias ARN. | ||
| 105 | When using an alias name, prefix it with C<"alias/">. To specify a CMK | ||
| 106 | in a different AWS account, you must use the key ARN or alias ARN. | ||
| 107 | |||
| 108 | For example: | ||
| 109 | |||
| 110 | =over | ||
| 111 | |||
| 112 | =item * | ||
| 113 | |||
| 114 | Key ID: C<1234abcd-12ab-34cd-56ef-1234567890ab> | ||
| 115 | |||
| 116 | =item * | ||
| 117 | |||
| 118 | Key ARN: | ||
| 119 | C<arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab> | ||
| 120 | |||
| 121 | =item * | ||
| 122 | |||
| 123 | Alias name: C<alias/ExampleAlias> | ||
| 124 | |||
| 125 | =item * | ||
| 126 | |||
| 127 | Alias ARN: C<arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias> | ||
| 128 | |||
| 129 | =back | ||
| 130 | |||
| 131 | To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. | ||
| 132 | To get the alias name and alias ARN, use ListAliases. | ||
| 133 | |||
| 134 | |||
| 135 | |||
| 136 | =head2 B<REQUIRED> Plaintext => Str | ||
| 137 | |||
| 138 | Data to be encrypted. | ||
| 139 | |||
| 140 | |||
| 141 | |||
| 142 | |||
| 143 | =head1 SEE ALSO | ||
| 144 | |||
| 145 | This class forms part of L<Paws>, documenting arguments for method Encrypt in L<Paws::KMS> | ||
| 146 | |||
| 147 | =head1 BUGS and CONTRIBUTIONS | ||
| 148 | |||
| 149 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 150 | |||
| 151 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 152 | |||
| 153 | =cut | ||
| 154 |