aws_sdk_kms/operation/sign/
_sign_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 SignOutput {
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 sign the message.</p>
7    pub key_id: ::std::option::Option<::std::string::String>,
8    /// <p>The cryptographic signature that was generated for the message.</p>
9    /// <ul>
10    /// <li>
11    /// <p>When used with the supported RSA signing algorithms, the encoding of this value is defined by <a href="https://tools.ietf.org/html/rfc8017">PKCS #1 in RFC 8017</a>.</p></li>
12    /// <li>
13    /// <p>When used with the <code>ECDSA_SHA_256</code>, <code>ECDSA_SHA_384</code>, or <code>ECDSA_SHA_512</code> signing algorithms, this value is a DER-encoded object as defined by ANSI X9.62–2005 and <a href="https://tools.ietf.org/html/rfc3279#section-2.2.3">RFC 3279 Section 2.2.3</a>. This is the most commonly used signature format and is appropriate for most uses.</p></li>
14    /// </ul>
15    /// <p>When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
16    pub signature: ::std::option::Option<::aws_smithy_types::Blob>,
17    /// <p>The signing algorithm that was used to sign the message.</p>
18    pub signing_algorithm: ::std::option::Option<crate::types::SigningAlgorithmSpec>,
19    _request_id: Option<String>,
20}
21impl SignOutput {
22    /// <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 sign the message.</p>
23    pub fn key_id(&self) -> ::std::option::Option<&str> {
24        self.key_id.as_deref()
25    }
26    /// <p>The cryptographic signature that was generated for the message.</p>
27    /// <ul>
28    /// <li>
29    /// <p>When used with the supported RSA signing algorithms, the encoding of this value is defined by <a href="https://tools.ietf.org/html/rfc8017">PKCS #1 in RFC 8017</a>.</p></li>
30    /// <li>
31    /// <p>When used with the <code>ECDSA_SHA_256</code>, <code>ECDSA_SHA_384</code>, or <code>ECDSA_SHA_512</code> signing algorithms, this value is a DER-encoded object as defined by ANSI X9.62–2005 and <a href="https://tools.ietf.org/html/rfc3279#section-2.2.3">RFC 3279 Section 2.2.3</a>. This is the most commonly used signature format and is appropriate for most uses.</p></li>
32    /// </ul>
33    /// <p>When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
34    pub fn signature(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
35        self.signature.as_ref()
36    }
37    /// <p>The signing algorithm that was used to sign the message.</p>
38    pub fn signing_algorithm(&self) -> ::std::option::Option<&crate::types::SigningAlgorithmSpec> {
39        self.signing_algorithm.as_ref()
40    }
41}
42impl ::aws_types::request_id::RequestId for SignOutput {
43    fn request_id(&self) -> Option<&str> {
44        self._request_id.as_deref()
45    }
46}
47impl SignOutput {
48    /// Creates a new builder-style object to manufacture [`SignOutput`](crate::operation::sign::SignOutput).
49    pub fn builder() -> crate::operation::sign::builders::SignOutputBuilder {
50        crate::operation::sign::builders::SignOutputBuilder::default()
51    }
52}
53
54/// A builder for [`SignOutput`](crate::operation::sign::SignOutput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct SignOutputBuilder {
58    pub(crate) key_id: ::std::option::Option<::std::string::String>,
59    pub(crate) signature: ::std::option::Option<::aws_smithy_types::Blob>,
60    pub(crate) signing_algorithm: ::std::option::Option<crate::types::SigningAlgorithmSpec>,
61    _request_id: Option<String>,
62}
63impl SignOutputBuilder {
64    /// <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 sign the message.</p>
65    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.key_id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <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 sign the message.</p>
70    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.key_id = input;
72        self
73    }
74    /// <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 sign the message.</p>
75    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.key_id
77    }
78    /// <p>The cryptographic signature that was generated for the message.</p>
79    /// <ul>
80    /// <li>
81    /// <p>When used with the supported RSA signing algorithms, the encoding of this value is defined by <a href="https://tools.ietf.org/html/rfc8017">PKCS #1 in RFC 8017</a>.</p></li>
82    /// <li>
83    /// <p>When used with the <code>ECDSA_SHA_256</code>, <code>ECDSA_SHA_384</code>, or <code>ECDSA_SHA_512</code> signing algorithms, this value is a DER-encoded object as defined by ANSI X9.62–2005 and <a href="https://tools.ietf.org/html/rfc3279#section-2.2.3">RFC 3279 Section 2.2.3</a>. This is the most commonly used signature format and is appropriate for most uses.</p></li>
84    /// </ul>
85    /// <p>When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
86    pub fn signature(mut self, input: ::aws_smithy_types::Blob) -> Self {
87        self.signature = ::std::option::Option::Some(input);
88        self
89    }
90    /// <p>The cryptographic signature that was generated for the message.</p>
91    /// <ul>
92    /// <li>
93    /// <p>When used with the supported RSA signing algorithms, the encoding of this value is defined by <a href="https://tools.ietf.org/html/rfc8017">PKCS #1 in RFC 8017</a>.</p></li>
94    /// <li>
95    /// <p>When used with the <code>ECDSA_SHA_256</code>, <code>ECDSA_SHA_384</code>, or <code>ECDSA_SHA_512</code> signing algorithms, this value is a DER-encoded object as defined by ANSI X9.62–2005 and <a href="https://tools.ietf.org/html/rfc3279#section-2.2.3">RFC 3279 Section 2.2.3</a>. This is the most commonly used signature format and is appropriate for most uses.</p></li>
96    /// </ul>
97    /// <p>When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
98    pub fn set_signature(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
99        self.signature = input;
100        self
101    }
102    /// <p>The cryptographic signature that was generated for the message.</p>
103    /// <ul>
104    /// <li>
105    /// <p>When used with the supported RSA signing algorithms, the encoding of this value is defined by <a href="https://tools.ietf.org/html/rfc8017">PKCS #1 in RFC 8017</a>.</p></li>
106    /// <li>
107    /// <p>When used with the <code>ECDSA_SHA_256</code>, <code>ECDSA_SHA_384</code>, or <code>ECDSA_SHA_512</code> signing algorithms, this value is a DER-encoded object as defined by ANSI X9.62–2005 and <a href="https://tools.ietf.org/html/rfc3279#section-2.2.3">RFC 3279 Section 2.2.3</a>. This is the most commonly used signature format and is appropriate for most uses.</p></li>
108    /// </ul>
109    /// <p>When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
110    pub fn get_signature(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
111        &self.signature
112    }
113    /// <p>The signing algorithm that was used to sign the message.</p>
114    pub fn signing_algorithm(mut self, input: crate::types::SigningAlgorithmSpec) -> Self {
115        self.signing_algorithm = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>The signing algorithm that was used to sign the message.</p>
119    pub fn set_signing_algorithm(mut self, input: ::std::option::Option<crate::types::SigningAlgorithmSpec>) -> Self {
120        self.signing_algorithm = input;
121        self
122    }
123    /// <p>The signing algorithm that was used to sign the message.</p>
124    pub fn get_signing_algorithm(&self) -> &::std::option::Option<crate::types::SigningAlgorithmSpec> {
125        &self.signing_algorithm
126    }
127    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
128        self._request_id = Some(request_id.into());
129        self
130    }
131
132    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
133        self._request_id = request_id;
134        self
135    }
136    /// Consumes the builder and constructs a [`SignOutput`](crate::operation::sign::SignOutput).
137    pub fn build(self) -> crate::operation::sign::SignOutput {
138        crate::operation::sign::SignOutput {
139            key_id: self.key_id,
140            signature: self.signature,
141            signing_algorithm: self.signing_algorithm,
142            _request_id: self._request_id,
143        }
144    }
145}