aws_sdk_kms/operation/verify/_verify_output.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, ::std::fmt::Debug)]
5pub struct VerifyOutput {
6 /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p>
7 pub key_id: ::std::option::Option<::std::string::String>,
8 /// <p>A Boolean value that indicates whether the signature was verified. A value of <code>True</code> indicates that the <code>Signature</code> was produced by signing the <code>Message</code> with the specified <code>KeyID</code> and <code>SigningAlgorithm.</code> If the signature is not verified, the <code>Verify</code> operation fails with a <code>KMSInvalidSignatureException</code> exception.</p>
9 pub signature_valid: bool,
10 /// <p>The signing algorithm that was used to verify the signature.</p>
11 pub signing_algorithm: ::std::option::Option<crate::types::SigningAlgorithmSpec>,
12 _request_id: Option<String>,
13}
14impl VerifyOutput {
15 /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p>
16 pub fn key_id(&self) -> ::std::option::Option<&str> {
17 self.key_id.as_deref()
18 }
19 /// <p>A Boolean value that indicates whether the signature was verified. A value of <code>True</code> indicates that the <code>Signature</code> was produced by signing the <code>Message</code> with the specified <code>KeyID</code> and <code>SigningAlgorithm.</code> If the signature is not verified, the <code>Verify</code> operation fails with a <code>KMSInvalidSignatureException</code> exception.</p>
20 pub fn signature_valid(&self) -> bool {
21 self.signature_valid
22 }
23 /// <p>The signing algorithm that was used to verify the signature.</p>
24 pub fn signing_algorithm(&self) -> ::std::option::Option<&crate::types::SigningAlgorithmSpec> {
25 self.signing_algorithm.as_ref()
26 }
27}
28impl ::aws_types::request_id::RequestId for VerifyOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl VerifyOutput {
34 /// Creates a new builder-style object to manufacture [`VerifyOutput`](crate::operation::verify::VerifyOutput).
35 pub fn builder() -> crate::operation::verify::builders::VerifyOutputBuilder {
36 crate::operation::verify::builders::VerifyOutputBuilder::default()
37 }
38}
39
40/// A builder for [`VerifyOutput`](crate::operation::verify::VerifyOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct VerifyOutputBuilder {
44 pub(crate) key_id: ::std::option::Option<::std::string::String>,
45 pub(crate) signature_valid: ::std::option::Option<bool>,
46 pub(crate) signing_algorithm: ::std::option::Option<crate::types::SigningAlgorithmSpec>,
47 _request_id: Option<String>,
48}
49impl VerifyOutputBuilder {
50 /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p>
51 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52 self.key_id = ::std::option::Option::Some(input.into());
53 self
54 }
55 /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p>
56 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.key_id = input;
58 self
59 }
60 /// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the asymmetric KMS key that was used to verify the signature.</p>
61 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
62 &self.key_id
63 }
64 /// <p>A Boolean value that indicates whether the signature was verified. A value of <code>True</code> indicates that the <code>Signature</code> was produced by signing the <code>Message</code> with the specified <code>KeyID</code> and <code>SigningAlgorithm.</code> If the signature is not verified, the <code>Verify</code> operation fails with a <code>KMSInvalidSignatureException</code> exception.</p>
65 pub fn signature_valid(mut self, input: bool) -> Self {
66 self.signature_valid = ::std::option::Option::Some(input);
67 self
68 }
69 /// <p>A Boolean value that indicates whether the signature was verified. A value of <code>True</code> indicates that the <code>Signature</code> was produced by signing the <code>Message</code> with the specified <code>KeyID</code> and <code>SigningAlgorithm.</code> If the signature is not verified, the <code>Verify</code> operation fails with a <code>KMSInvalidSignatureException</code> exception.</p>
70 pub fn set_signature_valid(mut self, input: ::std::option::Option<bool>) -> Self {
71 self.signature_valid = input;
72 self
73 }
74 /// <p>A Boolean value that indicates whether the signature was verified. A value of <code>True</code> indicates that the <code>Signature</code> was produced by signing the <code>Message</code> with the specified <code>KeyID</code> and <code>SigningAlgorithm.</code> If the signature is not verified, the <code>Verify</code> operation fails with a <code>KMSInvalidSignatureException</code> exception.</p>
75 pub fn get_signature_valid(&self) -> &::std::option::Option<bool> {
76 &self.signature_valid
77 }
78 /// <p>The signing algorithm that was used to verify the signature.</p>
79 pub fn signing_algorithm(mut self, input: crate::types::SigningAlgorithmSpec) -> Self {
80 self.signing_algorithm = ::std::option::Option::Some(input);
81 self
82 }
83 /// <p>The signing algorithm that was used to verify the signature.</p>
84 pub fn set_signing_algorithm(mut self, input: ::std::option::Option<crate::types::SigningAlgorithmSpec>) -> Self {
85 self.signing_algorithm = input;
86 self
87 }
88 /// <p>The signing algorithm that was used to verify the signature.</p>
89 pub fn get_signing_algorithm(&self) -> &::std::option::Option<crate::types::SigningAlgorithmSpec> {
90 &self.signing_algorithm
91 }
92 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93 self._request_id = Some(request_id.into());
94 self
95 }
96
97 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98 self._request_id = request_id;
99 self
100 }
101 /// Consumes the builder and constructs a [`VerifyOutput`](crate::operation::verify::VerifyOutput).
102 pub fn build(self) -> crate::operation::verify::VerifyOutput {
103 crate::operation::verify::VerifyOutput {
104 key_id: self.key_id,
105 signature_valid: self.signature_valid.unwrap_or_default(),
106 signing_algorithm: self.signing_algorithm,
107 _request_id: self._request_id,
108 }
109 }
110}