aws_sdk_kms/operation/verify/
_verify_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct VerifyInput {
6    /// <p>Identifies the asymmetric KMS key that will be used to verify the signature. This must be the same KMS key that was used to generate the signature. If you specify a different KMS key, the signature verification fails.</p>
7    /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
8    /// <p>For example:</p>
9    /// <ul>
10    /// <li>
11    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
12    /// <li>
13    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
14    /// <li>
15    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
16    /// <li>
17    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
18    /// </ul>
19    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
20    pub key_id: ::std::option::Option<::std::string::String>,
21    /// <p>Specifies the message that was signed. You can submit a raw message of up to 4096 bytes, or a hash digest of the message. If you submit a digest, use the <code>MessageType</code> parameter with a value of <code>DIGEST</code>.</p>
22    /// <p>If the message specified here is different from the message that was signed, the signature verification fails. A message and its hash digest are considered to be the same message.</p>
23    pub message: ::std::option::Option<::aws_smithy_types::Blob>,
24    /// <p>Tells KMS whether the value of the <code>Message</code> parameter should be hashed as part of the signing algorithm. Use <code>RAW</code> for unhashed messages; use <code>DIGEST</code> for message digests, which are already hashed.</p>
25    /// <p>When the value of <code>MessageType</code> is <code>RAW</code>, KMS uses the standard signing algorithm, which begins with a hash function. When the value is <code>DIGEST</code>, KMS skips the hashing step in the signing algorithm.</p><important>
26    /// <p>Use the <code>DIGEST</code> value only when the value of the <code>Message</code> parameter is a message digest. If you use the <code>DIGEST</code> value with an unhashed message, the security of the verification operation can be compromised.</p>
27    /// </important>
28    /// <p>When the value of <code>MessageType</code>is <code>DIGEST</code>, the length of the <code>Message</code> value must match the length of hashed messages for the specified signing algorithm.</p>
29    /// <p>You can submit a message digest and omit the <code>MessageType</code> or specify <code>RAW</code> so the digest is hashed again while signing. However, if the signed message is hashed once while signing, but twice while verifying, verification fails, even when the message hasn't changed.</p>
30    /// <p>The hashing algorithm in that <code>Verify</code> uses is based on the <code>SigningAlgorithm</code> value.</p>
31    /// <ul>
32    /// <li>
33    /// <p>Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm.</p></li>
34    /// <li>
35    /// <p>Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm.</p></li>
36    /// <li>
37    /// <p>Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm.</p></li>
38    /// <li>
39    /// <p>SM2DSA uses the SM3 hashing algorithm. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification">Offline verification with SM2 key pairs</a>.</p></li>
40    /// </ul>
41    pub message_type: ::std::option::Option<crate::types::MessageType>,
42    /// <p>The signature that the <code>Sign</code> operation generated.</p>
43    pub signature: ::std::option::Option<::aws_smithy_types::Blob>,
44    /// <p>The signing algorithm that was used to sign the message. If you submit a different algorithm, the signature verification fails.</p>
45    pub signing_algorithm: ::std::option::Option<crate::types::SigningAlgorithmSpec>,
46    /// <p>A list of grant tokens.</p>
47    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
48    pub grant_tokens: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
49    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
50    /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
51    pub dry_run: ::std::option::Option<bool>,
52}
53impl VerifyInput {
54    /// <p>Identifies the asymmetric KMS key that will be used to verify the signature. This must be the same KMS key that was used to generate the signature. If you specify a different KMS key, the signature verification fails.</p>
55    /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
56    /// <p>For example:</p>
57    /// <ul>
58    /// <li>
59    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
60    /// <li>
61    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
62    /// <li>
63    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
64    /// <li>
65    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
66    /// </ul>
67    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
68    pub fn key_id(&self) -> ::std::option::Option<&str> {
69        self.key_id.as_deref()
70    }
71    /// <p>Specifies the message that was signed. You can submit a raw message of up to 4096 bytes, or a hash digest of the message. If you submit a digest, use the <code>MessageType</code> parameter with a value of <code>DIGEST</code>.</p>
72    /// <p>If the message specified here is different from the message that was signed, the signature verification fails. A message and its hash digest are considered to be the same message.</p>
73    pub fn message(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
74        self.message.as_ref()
75    }
76    /// <p>Tells KMS whether the value of the <code>Message</code> parameter should be hashed as part of the signing algorithm. Use <code>RAW</code> for unhashed messages; use <code>DIGEST</code> for message digests, which are already hashed.</p>
77    /// <p>When the value of <code>MessageType</code> is <code>RAW</code>, KMS uses the standard signing algorithm, which begins with a hash function. When the value is <code>DIGEST</code>, KMS skips the hashing step in the signing algorithm.</p><important>
78    /// <p>Use the <code>DIGEST</code> value only when the value of the <code>Message</code> parameter is a message digest. If you use the <code>DIGEST</code> value with an unhashed message, the security of the verification operation can be compromised.</p>
79    /// </important>
80    /// <p>When the value of <code>MessageType</code>is <code>DIGEST</code>, the length of the <code>Message</code> value must match the length of hashed messages for the specified signing algorithm.</p>
81    /// <p>You can submit a message digest and omit the <code>MessageType</code> or specify <code>RAW</code> so the digest is hashed again while signing. However, if the signed message is hashed once while signing, but twice while verifying, verification fails, even when the message hasn't changed.</p>
82    /// <p>The hashing algorithm in that <code>Verify</code> uses is based on the <code>SigningAlgorithm</code> value.</p>
83    /// <ul>
84    /// <li>
85    /// <p>Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm.</p></li>
86    /// <li>
87    /// <p>Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm.</p></li>
88    /// <li>
89    /// <p>Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm.</p></li>
90    /// <li>
91    /// <p>SM2DSA uses the SM3 hashing algorithm. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification">Offline verification with SM2 key pairs</a>.</p></li>
92    /// </ul>
93    pub fn message_type(&self) -> ::std::option::Option<&crate::types::MessageType> {
94        self.message_type.as_ref()
95    }
96    /// <p>The signature that the <code>Sign</code> operation generated.</p>
97    pub fn signature(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
98        self.signature.as_ref()
99    }
100    /// <p>The signing algorithm that was used to sign the message. If you submit a different algorithm, the signature verification fails.</p>
101    pub fn signing_algorithm(&self) -> ::std::option::Option<&crate::types::SigningAlgorithmSpec> {
102        self.signing_algorithm.as_ref()
103    }
104    /// <p>A list of grant tokens.</p>
105    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
106    ///
107    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.grant_tokens.is_none()`.
108    pub fn grant_tokens(&self) -> &[::std::string::String] {
109        self.grant_tokens.as_deref().unwrap_or_default()
110    }
111    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
112    /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
113    pub fn dry_run(&self) -> ::std::option::Option<bool> {
114        self.dry_run
115    }
116}
117impl ::std::fmt::Debug for VerifyInput {
118    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
119        let mut formatter = f.debug_struct("VerifyInput");
120        formatter.field("key_id", &self.key_id);
121        formatter.field("message", &"*** Sensitive Data Redacted ***");
122        formatter.field("message_type", &self.message_type);
123        formatter.field("signature", &self.signature);
124        formatter.field("signing_algorithm", &self.signing_algorithm);
125        formatter.field("grant_tokens", &self.grant_tokens);
126        formatter.field("dry_run", &self.dry_run);
127        formatter.finish()
128    }
129}
130impl VerifyInput {
131    /// Creates a new builder-style object to manufacture [`VerifyInput`](crate::operation::verify::VerifyInput).
132    pub fn builder() -> crate::operation::verify::builders::VerifyInputBuilder {
133        crate::operation::verify::builders::VerifyInputBuilder::default()
134    }
135}
136
137/// A builder for [`VerifyInput`](crate::operation::verify::VerifyInput).
138#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
139#[non_exhaustive]
140pub struct VerifyInputBuilder {
141    pub(crate) key_id: ::std::option::Option<::std::string::String>,
142    pub(crate) message: ::std::option::Option<::aws_smithy_types::Blob>,
143    pub(crate) message_type: ::std::option::Option<crate::types::MessageType>,
144    pub(crate) signature: ::std::option::Option<::aws_smithy_types::Blob>,
145    pub(crate) signing_algorithm: ::std::option::Option<crate::types::SigningAlgorithmSpec>,
146    pub(crate) grant_tokens: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
147    pub(crate) dry_run: ::std::option::Option<bool>,
148}
149impl VerifyInputBuilder {
150    /// <p>Identifies the asymmetric KMS key that will be used to verify the signature. This must be the same KMS key that was used to generate the signature. If you specify a different KMS key, the signature verification fails.</p>
151    /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
152    /// <p>For example:</p>
153    /// <ul>
154    /// <li>
155    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
156    /// <li>
157    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
158    /// <li>
159    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
160    /// <li>
161    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
162    /// </ul>
163    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
164    /// This field is required.
165    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.key_id = ::std::option::Option::Some(input.into());
167        self
168    }
169    /// <p>Identifies the asymmetric KMS key that will be used to verify the signature. This must be the same KMS key that was used to generate the signature. If you specify a different KMS key, the signature verification fails.</p>
170    /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
171    /// <p>For example:</p>
172    /// <ul>
173    /// <li>
174    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
175    /// <li>
176    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
177    /// <li>
178    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
179    /// <li>
180    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
181    /// </ul>
182    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
183    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.key_id = input;
185        self
186    }
187    /// <p>Identifies the asymmetric KMS key that will be used to verify the signature. This must be the same KMS key that was used to generate the signature. If you specify a different KMS key, the signature verification fails.</p>
188    /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
189    /// <p>For example:</p>
190    /// <ul>
191    /// <li>
192    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
193    /// <li>
194    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
195    /// <li>
196    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
197    /// <li>
198    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
199    /// </ul>
200    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
201    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
202        &self.key_id
203    }
204    /// <p>Specifies the message that was signed. You can submit a raw message of up to 4096 bytes, or a hash digest of the message. If you submit a digest, use the <code>MessageType</code> parameter with a value of <code>DIGEST</code>.</p>
205    /// <p>If the message specified here is different from the message that was signed, the signature verification fails. A message and its hash digest are considered to be the same message.</p>
206    /// This field is required.
207    pub fn message(mut self, input: ::aws_smithy_types::Blob) -> Self {
208        self.message = ::std::option::Option::Some(input);
209        self
210    }
211    /// <p>Specifies the message that was signed. You can submit a raw message of up to 4096 bytes, or a hash digest of the message. If you submit a digest, use the <code>MessageType</code> parameter with a value of <code>DIGEST</code>.</p>
212    /// <p>If the message specified here is different from the message that was signed, the signature verification fails. A message and its hash digest are considered to be the same message.</p>
213    pub fn set_message(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
214        self.message = input;
215        self
216    }
217    /// <p>Specifies the message that was signed. You can submit a raw message of up to 4096 bytes, or a hash digest of the message. If you submit a digest, use the <code>MessageType</code> parameter with a value of <code>DIGEST</code>.</p>
218    /// <p>If the message specified here is different from the message that was signed, the signature verification fails. A message and its hash digest are considered to be the same message.</p>
219    pub fn get_message(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
220        &self.message
221    }
222    /// <p>Tells KMS whether the value of the <code>Message</code> parameter should be hashed as part of the signing algorithm. Use <code>RAW</code> for unhashed messages; use <code>DIGEST</code> for message digests, which are already hashed.</p>
223    /// <p>When the value of <code>MessageType</code> is <code>RAW</code>, KMS uses the standard signing algorithm, which begins with a hash function. When the value is <code>DIGEST</code>, KMS skips the hashing step in the signing algorithm.</p><important>
224    /// <p>Use the <code>DIGEST</code> value only when the value of the <code>Message</code> parameter is a message digest. If you use the <code>DIGEST</code> value with an unhashed message, the security of the verification operation can be compromised.</p>
225    /// </important>
226    /// <p>When the value of <code>MessageType</code>is <code>DIGEST</code>, the length of the <code>Message</code> value must match the length of hashed messages for the specified signing algorithm.</p>
227    /// <p>You can submit a message digest and omit the <code>MessageType</code> or specify <code>RAW</code> so the digest is hashed again while signing. However, if the signed message is hashed once while signing, but twice while verifying, verification fails, even when the message hasn't changed.</p>
228    /// <p>The hashing algorithm in that <code>Verify</code> uses is based on the <code>SigningAlgorithm</code> value.</p>
229    /// <ul>
230    /// <li>
231    /// <p>Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm.</p></li>
232    /// <li>
233    /// <p>Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm.</p></li>
234    /// <li>
235    /// <p>Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm.</p></li>
236    /// <li>
237    /// <p>SM2DSA uses the SM3 hashing algorithm. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification">Offline verification with SM2 key pairs</a>.</p></li>
238    /// </ul>
239    pub fn message_type(mut self, input: crate::types::MessageType) -> Self {
240        self.message_type = ::std::option::Option::Some(input);
241        self
242    }
243    /// <p>Tells KMS whether the value of the <code>Message</code> parameter should be hashed as part of the signing algorithm. Use <code>RAW</code> for unhashed messages; use <code>DIGEST</code> for message digests, which are already hashed.</p>
244    /// <p>When the value of <code>MessageType</code> is <code>RAW</code>, KMS uses the standard signing algorithm, which begins with a hash function. When the value is <code>DIGEST</code>, KMS skips the hashing step in the signing algorithm.</p><important>
245    /// <p>Use the <code>DIGEST</code> value only when the value of the <code>Message</code> parameter is a message digest. If you use the <code>DIGEST</code> value with an unhashed message, the security of the verification operation can be compromised.</p>
246    /// </important>
247    /// <p>When the value of <code>MessageType</code>is <code>DIGEST</code>, the length of the <code>Message</code> value must match the length of hashed messages for the specified signing algorithm.</p>
248    /// <p>You can submit a message digest and omit the <code>MessageType</code> or specify <code>RAW</code> so the digest is hashed again while signing. However, if the signed message is hashed once while signing, but twice while verifying, verification fails, even when the message hasn't changed.</p>
249    /// <p>The hashing algorithm in that <code>Verify</code> uses is based on the <code>SigningAlgorithm</code> value.</p>
250    /// <ul>
251    /// <li>
252    /// <p>Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm.</p></li>
253    /// <li>
254    /// <p>Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm.</p></li>
255    /// <li>
256    /// <p>Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm.</p></li>
257    /// <li>
258    /// <p>SM2DSA uses the SM3 hashing algorithm. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification">Offline verification with SM2 key pairs</a>.</p></li>
259    /// </ul>
260    pub fn set_message_type(mut self, input: ::std::option::Option<crate::types::MessageType>) -> Self {
261        self.message_type = input;
262        self
263    }
264    /// <p>Tells KMS whether the value of the <code>Message</code> parameter should be hashed as part of the signing algorithm. Use <code>RAW</code> for unhashed messages; use <code>DIGEST</code> for message digests, which are already hashed.</p>
265    /// <p>When the value of <code>MessageType</code> is <code>RAW</code>, KMS uses the standard signing algorithm, which begins with a hash function. When the value is <code>DIGEST</code>, KMS skips the hashing step in the signing algorithm.</p><important>
266    /// <p>Use the <code>DIGEST</code> value only when the value of the <code>Message</code> parameter is a message digest. If you use the <code>DIGEST</code> value with an unhashed message, the security of the verification operation can be compromised.</p>
267    /// </important>
268    /// <p>When the value of <code>MessageType</code>is <code>DIGEST</code>, the length of the <code>Message</code> value must match the length of hashed messages for the specified signing algorithm.</p>
269    /// <p>You can submit a message digest and omit the <code>MessageType</code> or specify <code>RAW</code> so the digest is hashed again while signing. However, if the signed message is hashed once while signing, but twice while verifying, verification fails, even when the message hasn't changed.</p>
270    /// <p>The hashing algorithm in that <code>Verify</code> uses is based on the <code>SigningAlgorithm</code> value.</p>
271    /// <ul>
272    /// <li>
273    /// <p>Signing algorithms that end in SHA_256 use the SHA_256 hashing algorithm.</p></li>
274    /// <li>
275    /// <p>Signing algorithms that end in SHA_384 use the SHA_384 hashing algorithm.</p></li>
276    /// <li>
277    /// <p>Signing algorithms that end in SHA_512 use the SHA_512 hashing algorithm.</p></li>
278    /// <li>
279    /// <p>SM2DSA uses the SM3 hashing algorithm. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification">Offline verification with SM2 key pairs</a>.</p></li>
280    /// </ul>
281    pub fn get_message_type(&self) -> &::std::option::Option<crate::types::MessageType> {
282        &self.message_type
283    }
284    /// <p>The signature that the <code>Sign</code> operation generated.</p>
285    /// This field is required.
286    pub fn signature(mut self, input: ::aws_smithy_types::Blob) -> Self {
287        self.signature = ::std::option::Option::Some(input);
288        self
289    }
290    /// <p>The signature that the <code>Sign</code> operation generated.</p>
291    pub fn set_signature(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
292        self.signature = input;
293        self
294    }
295    /// <p>The signature that the <code>Sign</code> operation generated.</p>
296    pub fn get_signature(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
297        &self.signature
298    }
299    /// <p>The signing algorithm that was used to sign the message. If you submit a different algorithm, the signature verification fails.</p>
300    /// This field is required.
301    pub fn signing_algorithm(mut self, input: crate::types::SigningAlgorithmSpec) -> Self {
302        self.signing_algorithm = ::std::option::Option::Some(input);
303        self
304    }
305    /// <p>The signing algorithm that was used to sign the message. If you submit a different algorithm, the signature verification fails.</p>
306    pub fn set_signing_algorithm(mut self, input: ::std::option::Option<crate::types::SigningAlgorithmSpec>) -> Self {
307        self.signing_algorithm = input;
308        self
309    }
310    /// <p>The signing algorithm that was used to sign the message. If you submit a different algorithm, the signature verification fails.</p>
311    pub fn get_signing_algorithm(&self) -> &::std::option::Option<crate::types::SigningAlgorithmSpec> {
312        &self.signing_algorithm
313    }
314    /// Appends an item to `grant_tokens`.
315    ///
316    /// To override the contents of this collection use [`set_grant_tokens`](Self::set_grant_tokens).
317    ///
318    /// <p>A list of grant tokens.</p>
319    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
320    pub fn grant_tokens(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
321        let mut v = self.grant_tokens.unwrap_or_default();
322        v.push(input.into());
323        self.grant_tokens = ::std::option::Option::Some(v);
324        self
325    }
326    /// <p>A list of grant tokens.</p>
327    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
328    pub fn set_grant_tokens(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
329        self.grant_tokens = input;
330        self
331    }
332    /// <p>A list of grant tokens.</p>
333    /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
334    pub fn get_grant_tokens(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
335        &self.grant_tokens
336    }
337    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
338    /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
339    pub fn dry_run(mut self, input: bool) -> Self {
340        self.dry_run = ::std::option::Option::Some(input);
341        self
342    }
343    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
344    /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
345    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
346        self.dry_run = input;
347        self
348    }
349    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
350    /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
351    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
352        &self.dry_run
353    }
354    /// Consumes the builder and constructs a [`VerifyInput`](crate::operation::verify::VerifyInput).
355    pub fn build(self) -> ::std::result::Result<crate::operation::verify::VerifyInput, ::aws_smithy_types::error::operation::BuildError> {
356        ::std::result::Result::Ok(crate::operation::verify::VerifyInput {
357            key_id: self.key_id,
358            message: self.message,
359            message_type: self.message_type,
360            signature: self.signature,
361            signing_algorithm: self.signing_algorithm,
362            grant_tokens: self.grant_tokens,
363            dry_run: self.dry_run,
364        })
365    }
366}
367impl ::std::fmt::Debug for VerifyInputBuilder {
368    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
369        let mut formatter = f.debug_struct("VerifyInputBuilder");
370        formatter.field("key_id", &self.key_id);
371        formatter.field("message", &"*** Sensitive Data Redacted ***");
372        formatter.field("message_type", &self.message_type);
373        formatter.field("signature", &self.signature);
374        formatter.field("signing_algorithm", &self.signing_algorithm);
375        formatter.field("grant_tokens", &self.grant_tokens);
376        formatter.field("dry_run", &self.dry_run);
377        formatter.finish()
378    }
379}