1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains X.509 extension information for a certificate.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Extensions {
/// <p>Contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
/// <p>In an end-entity certificate, these terms indicate the policy under which the certificate was issued and the purposes for which it may be used. In a CA certificate, these terms limit the set of policies for certification paths that include this certificate.</p>
pub certificate_policies: ::std::option::Option<::std::vec::Vec<crate::types::PolicyInformation>>,
/// <p>Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the <code>KeyUsage</code> extension.</p>
pub extended_key_usage: ::std::option::Option<::std::vec::Vec<crate::types::ExtendedKeyUsage>>,
/// <p>Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false.</p>
pub key_usage: ::std::option::Option<crate::types::KeyUsage>,
/// <p>The subject alternative name extension allows identities to be bound to the subject of the certificate. These identities may be included in addition to or in place of the identity in the subject field of the certificate.</p>
pub subject_alternative_names: ::std::option::Option<::std::vec::Vec<crate::types::GeneralName>>,
/// <p></p>
/// <p>Contains a sequence of one or more X.509 extensions, each of which consists of an object identifier (OID), a base64-encoded value, and the critical flag. For more information, see the <a href="https://oidref.com/2.5.29">Global OID reference database.</a></p>
pub custom_extensions: ::std::option::Option<::std::vec::Vec<crate::types::CustomExtension>>,
}
impl Extensions {
/// <p>Contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
/// <p>In an end-entity certificate, these terms indicate the policy under which the certificate was issued and the purposes for which it may be used. In a CA certificate, these terms limit the set of policies for certification paths that include this certificate.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.certificate_policies.is_none()`.
pub fn certificate_policies(&self) -> &[crate::types::PolicyInformation] {
self.certificate_policies.as_deref().unwrap_or_default()
}
/// <p>Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the <code>KeyUsage</code> extension.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.extended_key_usage.is_none()`.
pub fn extended_key_usage(&self) -> &[crate::types::ExtendedKeyUsage] {
self.extended_key_usage.as_deref().unwrap_or_default()
}
/// <p>Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false.</p>
pub fn key_usage(&self) -> ::std::option::Option<&crate::types::KeyUsage> {
self.key_usage.as_ref()
}
/// <p>The subject alternative name extension allows identities to be bound to the subject of the certificate. These identities may be included in addition to or in place of the identity in the subject field of the certificate.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subject_alternative_names.is_none()`.
pub fn subject_alternative_names(&self) -> &[crate::types::GeneralName] {
self.subject_alternative_names.as_deref().unwrap_or_default()
}
/// <p></p>
/// <p>Contains a sequence of one or more X.509 extensions, each of which consists of an object identifier (OID), a base64-encoded value, and the critical flag. For more information, see the <a href="https://oidref.com/2.5.29">Global OID reference database.</a></p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.custom_extensions.is_none()`.
pub fn custom_extensions(&self) -> &[crate::types::CustomExtension] {
self.custom_extensions.as_deref().unwrap_or_default()
}
}
impl Extensions {
/// Creates a new builder-style object to manufacture [`Extensions`](crate::types::Extensions).
pub fn builder() -> crate::types::builders::ExtensionsBuilder {
crate::types::builders::ExtensionsBuilder::default()
}
}
/// A builder for [`Extensions`](crate::types::Extensions).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ExtensionsBuilder {
pub(crate) certificate_policies: ::std::option::Option<::std::vec::Vec<crate::types::PolicyInformation>>,
pub(crate) extended_key_usage: ::std::option::Option<::std::vec::Vec<crate::types::ExtendedKeyUsage>>,
pub(crate) key_usage: ::std::option::Option<crate::types::KeyUsage>,
pub(crate) subject_alternative_names: ::std::option::Option<::std::vec::Vec<crate::types::GeneralName>>,
pub(crate) custom_extensions: ::std::option::Option<::std::vec::Vec<crate::types::CustomExtension>>,
}
impl ExtensionsBuilder {
/// Appends an item to `certificate_policies`.
///
/// To override the contents of this collection use [`set_certificate_policies`](Self::set_certificate_policies).
///
/// <p>Contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
/// <p>In an end-entity certificate, these terms indicate the policy under which the certificate was issued and the purposes for which it may be used. In a CA certificate, these terms limit the set of policies for certification paths that include this certificate.</p>
pub fn certificate_policies(mut self, input: crate::types::PolicyInformation) -> Self {
let mut v = self.certificate_policies.unwrap_or_default();
v.push(input);
self.certificate_policies = ::std::option::Option::Some(v);
self
}
/// <p>Contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
/// <p>In an end-entity certificate, these terms indicate the policy under which the certificate was issued and the purposes for which it may be used. In a CA certificate, these terms limit the set of policies for certification paths that include this certificate.</p>
pub fn set_certificate_policies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PolicyInformation>>) -> Self {
self.certificate_policies = input;
self
}
/// <p>Contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
/// <p>In an end-entity certificate, these terms indicate the policy under which the certificate was issued and the purposes for which it may be used. In a CA certificate, these terms limit the set of policies for certification paths that include this certificate.</p>
pub fn get_certificate_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PolicyInformation>> {
&self.certificate_policies
}
/// Appends an item to `extended_key_usage`.
///
/// To override the contents of this collection use [`set_extended_key_usage`](Self::set_extended_key_usage).
///
/// <p>Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the <code>KeyUsage</code> extension.</p>
pub fn extended_key_usage(mut self, input: crate::types::ExtendedKeyUsage) -> Self {
let mut v = self.extended_key_usage.unwrap_or_default();
v.push(input);
self.extended_key_usage = ::std::option::Option::Some(v);
self
}
/// <p>Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the <code>KeyUsage</code> extension.</p>
pub fn set_extended_key_usage(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ExtendedKeyUsage>>) -> Self {
self.extended_key_usage = input;
self
}
/// <p>Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the <code>KeyUsage</code> extension.</p>
pub fn get_extended_key_usage(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ExtendedKeyUsage>> {
&self.extended_key_usage
}
/// <p>Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false.</p>
pub fn key_usage(mut self, input: crate::types::KeyUsage) -> Self {
self.key_usage = ::std::option::Option::Some(input);
self
}
/// <p>Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false.</p>
pub fn set_key_usage(mut self, input: ::std::option::Option<crate::types::KeyUsage>) -> Self {
self.key_usage = input;
self
}
/// <p>Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false.</p>
pub fn get_key_usage(&self) -> &::std::option::Option<crate::types::KeyUsage> {
&self.key_usage
}
/// Appends an item to `subject_alternative_names`.
///
/// To override the contents of this collection use [`set_subject_alternative_names`](Self::set_subject_alternative_names).
///
/// <p>The subject alternative name extension allows identities to be bound to the subject of the certificate. These identities may be included in addition to or in place of the identity in the subject field of the certificate.</p>
pub fn subject_alternative_names(mut self, input: crate::types::GeneralName) -> Self {
let mut v = self.subject_alternative_names.unwrap_or_default();
v.push(input);
self.subject_alternative_names = ::std::option::Option::Some(v);
self
}
/// <p>The subject alternative name extension allows identities to be bound to the subject of the certificate. These identities may be included in addition to or in place of the identity in the subject field of the certificate.</p>
pub fn set_subject_alternative_names(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GeneralName>>) -> Self {
self.subject_alternative_names = input;
self
}
/// <p>The subject alternative name extension allows identities to be bound to the subject of the certificate. These identities may be included in addition to or in place of the identity in the subject field of the certificate.</p>
pub fn get_subject_alternative_names(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GeneralName>> {
&self.subject_alternative_names
}
/// Appends an item to `custom_extensions`.
///
/// To override the contents of this collection use [`set_custom_extensions`](Self::set_custom_extensions).
///
/// <p></p>
/// <p>Contains a sequence of one or more X.509 extensions, each of which consists of an object identifier (OID), a base64-encoded value, and the critical flag. For more information, see the <a href="https://oidref.com/2.5.29">Global OID reference database.</a></p>
pub fn custom_extensions(mut self, input: crate::types::CustomExtension) -> Self {
let mut v = self.custom_extensions.unwrap_or_default();
v.push(input);
self.custom_extensions = ::std::option::Option::Some(v);
self
}
/// <p></p>
/// <p>Contains a sequence of one or more X.509 extensions, each of which consists of an object identifier (OID), a base64-encoded value, and the critical flag. For more information, see the <a href="https://oidref.com/2.5.29">Global OID reference database.</a></p>
pub fn set_custom_extensions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CustomExtension>>) -> Self {
self.custom_extensions = input;
self
}
/// <p></p>
/// <p>Contains a sequence of one or more X.509 extensions, each of which consists of an object identifier (OID), a base64-encoded value, and the critical flag. For more information, see the <a href="https://oidref.com/2.5.29">Global OID reference database.</a></p>
pub fn get_custom_extensions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CustomExtension>> {
&self.custom_extensions
}
/// Consumes the builder and constructs a [`Extensions`](crate::types::Extensions).
pub fn build(self) -> crate::types::Extensions {
crate::types::Extensions {
certificate_policies: self.certificate_policies,
extended_key_usage: self.extended_key_usage,
key_usage: self.key_usage,
subject_alternative_names: self.subject_alternative_names,
custom_extensions: self.custom_extensions,
}
}
}