blib/lib/Paws/KMS/ReEncrypt.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 19 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::KMS::ReEncrypt;
3 use Moose;
4 has CiphertextBlob => (is => 'ro', isa => 'Str', required => 1);
5 has DestinationEncryptionAlgorithm => (is => 'ro', isa => 'Str');
6 has DestinationEncryptionContext => (is => 'ro', isa => 'Paws::KMS::EncryptionContextType');
7 has DestinationKeyId => (is => 'ro', isa => 'Str', required => 1);
8 has GrantTokens => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
9 has SourceEncryptionAlgorithm => (is => 'ro', isa => 'Str');
10 has SourceEncryptionContext => (is => 'ro', isa => 'Paws::KMS::EncryptionContextType');
11 has SourceKeyId => (is => 'ro', isa => 'Str');
12  
13 use MooseX::ClassAttribute;
14  
15 class_has _api_call => (isa => 'Str', is => 'ro', default => 'ReEncrypt');
16 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::KMS::ReEncryptResponse');
17 class_has _result_key => (isa => 'Str', is => 'ro');
18 1;
19  
20 ### main pod documentation begin ###
21  
22 =head1 NAME
23  
24 Paws::KMS::ReEncrypt - Arguments for method ReEncrypt on L<Paws::KMS>
25  
26 =head1 DESCRIPTION
27  
28 This class represents the parameters used for calling the method ReEncrypt on the
29 L<AWS Key Management Service|Paws::KMS> service. Use the attributes of this class
30 as arguments to method ReEncrypt.
31  
32 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to ReEncrypt.
33  
34 =head1 SYNOPSIS
35  
36 my $kms = Paws->service('KMS');
37 # To reencrypt data
38 # The following example reencrypts data with the specified CMK.
39 my $ReEncryptResponse = $kms->ReEncrypt(
40 'CiphertextBlob' => '<binary data>',
41 'DestinationKeyId' => '0987dcba-09fe-87dc-65ba-ab0987654321'
42 );
43  
44 # Results:
45 my $CiphertextBlob = $ReEncryptResponse->CiphertextBlob;
46 my $KeyId = $ReEncryptResponse->KeyId;
47 my $SourceKeyId = $ReEncryptResponse->SourceKeyId;
48  
49 # Returns a L<Paws::KMS::ReEncryptResponse> object.
50  
51 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.
52 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/kms/ReEncrypt>
53  
54 =head1 ATTRIBUTES
55  
56  
57 =head2 B<REQUIRED> CiphertextBlob => Str
58  
59 Ciphertext of the data to reencrypt.
60  
61  
62  
63 =head2 DestinationEncryptionAlgorithm => Str
64  
65 Specifies the encryption algorithm that AWS KMS will use to reecrypt
66 the data after it has decrypted it. The default value,
67 C<SYMMETRIC_DEFAULT>, represents the encryption algorithm used for
68 symmetric CMKs.
69  
70 This parameter is required only when the destination CMK is an
71 asymmetric CMK.
72  
73 Valid values are: C<"SYMMETRIC_DEFAULT">, C<"RSAES_OAEP_SHA_1">, C<"RSAES_OAEP_SHA_256">
74  
75 =head2 DestinationEncryptionContext => L<Paws::KMS::EncryptionContextType>
76  
77 Specifies that encryption context to use when the reencrypting the
78 data.
79  
80 A destination encryption context is valid only when the destination CMK
81 is a symmetric CMK. The standard ciphertext format for asymmetric CMKs
82 does not include fields for metadata.
83  
84 An I<encryption context> is a collection of non-secret key-value pairs
85 that represents additional authenticated data. When you use an
86 encryption context to encrypt data, you must specify the same (an exact
87 case-sensitive match) encryption context to decrypt the data. An
88 encryption context is optional when encrypting with a symmetric CMK,
89 but it is highly recommended.
90  
91 For more information, see Encryption Context
92 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
93 in the I<AWS Key Management Service Developer Guide>.
94  
95  
96  
97 =head2 B<REQUIRED> DestinationKeyId => Str
98  
99 A unique identifier for the CMK that is used to reencrypt the data.
100 Specify a symmetric or asymmetric CMK with a C<KeyUsage> value of
101 C<ENCRYPT_DECRYPT>. To find the C<KeyUsage> value of a CMK, use the
102 DescribeKey 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 GrantTokens => ArrayRef[Str|Undef]
137  
138 A list of grant tokens.
139  
140 Use a grant token when your permission to call this operation comes
141 from a new grant that has not yet achieved I<eventual consistency>. For
142 more information, see Grant token
143 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
144 in the I<AWS Key Management Service Developer Guide>.
145  
146  
147  
148 =head2 SourceEncryptionAlgorithm => Str
149  
150 Specifies the encryption algorithm that AWS KMS will use to decrypt the
151 ciphertext before it is reencrypted. The default value,
152 C<SYMMETRIC_DEFAULT>, represents the algorithm used for symmetric CMKs.
153  
154 Specify the same algorithm that was used to encrypt the ciphertext. If
155 you specify a different algorithm, the decrypt attempt fails.
156  
157 This parameter is required only when the ciphertext was encrypted under
158 an asymmetric CMK.
159  
160 Valid values are: C<"SYMMETRIC_DEFAULT">, C<"RSAES_OAEP_SHA_1">, C<"RSAES_OAEP_SHA_256">
161  
162 =head2 SourceEncryptionContext => L<Paws::KMS::EncryptionContextType>
163  
164 Specifies the encryption context to use to decrypt the ciphertext.
165 Enter the same encryption context that was used to encrypt the
166 ciphertext.
167  
168 An I<encryption context> is a collection of non-secret key-value pairs
169 that represents additional authenticated data. When you use an
170 encryption context to encrypt data, you must specify the same (an exact
171 case-sensitive match) encryption context to decrypt the data. An
172 encryption context is optional when encrypting with a symmetric CMK,
173 but it is highly recommended.
174  
175 For more information, see Encryption Context
176 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
177 in the I<AWS Key Management Service Developer Guide>.
178  
179  
180  
181 =head2 SourceKeyId => Str
182  
183 Specifies the customer master key (CMK) that AWS KMS will use to
184 decrypt the ciphertext before it is re-encrypted. Enter a key ID of the
185 CMK that was used to encrypt the ciphertext.
186  
187 This parameter is required only when the ciphertext was encrypted under
188 an asymmetric CMK. If you used a symmetric CMK, AWS KMS can get the CMK
189 from metadata that it adds to the symmetric ciphertext blob. However,
190 it is always recommended as a best practice. This practice ensures that
191 you use the CMK that you intend.
192  
193 To specify a CMK, use its key ID, key ARN, alias name, or alias ARN.
194 When using an alias name, prefix it with C<"alias/">. To specify a CMK
195 in a different AWS account, you must use the key ARN or alias ARN.
196  
197 For example:
198  
199 =over
200  
201 =item *
202  
203 Key ID: C<1234abcd-12ab-34cd-56ef-1234567890ab>
204  
205 =item *
206  
207 Key ARN:
208 C<arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab>
209  
210 =item *
211  
212 Alias name: C<alias/ExampleAlias>
213  
214 =item *
215  
216 Alias ARN: C<arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias>
217  
218 =back
219  
220 To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
221 To get the alias name and alias ARN, use ListAliases.
222  
223  
224  
225  
226 =head1 SEE ALSO
227  
228 This class forms part of L<Paws>, documenting arguments for method ReEncrypt in L<Paws::KMS>
229  
230 =head1 BUGS and CONTRIBUTIONS
231  
232 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
233  
234 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
235  
236 =cut
237