• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 // This file is generated by rust-protobuf 3.2.0. Do not edit
16 // .proto file is parsed by protoc 3.19.1
17 // @generated
18 
19 // https://github.com/rust-lang/rust-clippy/issues/702
20 #![allow(unknown_lints)]
21 #![allow(clippy::all)]
22 
23 #![allow(unused_attributes)]
24 #![cfg_attr(rustfmt, rustfmt::skip)]
25 
26 #![allow(box_pointers)]
27 #![allow(dead_code)]
28 #![allow(missing_docs)]
29 #![allow(non_camel_case_types)]
30 #![allow(non_snake_case)]
31 #![allow(non_upper_case_globals)]
32 #![allow(trivial_casts)]
33 #![allow(unused_results)]
34 #![allow(unused_mut)]
35 
36 //! Generated file from `securemessage.proto`
37 // Generated for lite runtime
38 
39 /// Generated files are compatible only with the same version
40 /// of protobuf runtime.
41 const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0;
42 
43 #[derive(PartialEq,Clone,Default,Debug)]
44 // @@protoc_insertion_point(message:securemessage.SecureMessage)
45 pub struct SecureMessage {
46     // message fields
47     // @@protoc_insertion_point(field:securemessage.SecureMessage.header_and_body)
48     pub header_and_body: ::std::option::Option<::std::vec::Vec<u8>>,
49     // @@protoc_insertion_point(field:securemessage.SecureMessage.signature)
50     pub signature: ::std::option::Option<::std::vec::Vec<u8>>,
51     // special fields
52     // @@protoc_insertion_point(special_field:securemessage.SecureMessage.special_fields)
53     pub special_fields: ::protobuf::SpecialFields,
54 }
55 
56 impl<'a> ::std::default::Default for &'a SecureMessage {
default() -> &'a SecureMessage57     fn default() -> &'a SecureMessage {
58         <SecureMessage as ::protobuf::Message>::default_instance()
59     }
60 }
61 
62 impl SecureMessage {
new() -> SecureMessage63     pub fn new() -> SecureMessage {
64         ::std::default::Default::default()
65     }
66 
67     // required bytes header_and_body = 1;
68 
header_and_body(&self) -> &[u8]69     pub fn header_and_body(&self) -> &[u8] {
70         match self.header_and_body.as_ref() {
71             Some(v) => v,
72             None => &[],
73         }
74     }
75 
clear_header_and_body(&mut self)76     pub fn clear_header_and_body(&mut self) {
77         self.header_and_body = ::std::option::Option::None;
78     }
79 
has_header_and_body(&self) -> bool80     pub fn has_header_and_body(&self) -> bool {
81         self.header_and_body.is_some()
82     }
83 
84     // Param is passed by value, moved
set_header_and_body(&mut self, v: ::std::vec::Vec<u8>)85     pub fn set_header_and_body(&mut self, v: ::std::vec::Vec<u8>) {
86         self.header_and_body = ::std::option::Option::Some(v);
87     }
88 
89     // Mutable pointer to the field.
90     // If field is not initialized, it is initialized with default value first.
mut_header_and_body(&mut self) -> &mut ::std::vec::Vec<u8>91     pub fn mut_header_and_body(&mut self) -> &mut ::std::vec::Vec<u8> {
92         if self.header_and_body.is_none() {
93             self.header_and_body = ::std::option::Option::Some(::std::vec::Vec::new());
94         }
95         self.header_and_body.as_mut().unwrap()
96     }
97 
98     // Take field
take_header_and_body(&mut self) -> ::std::vec::Vec<u8>99     pub fn take_header_and_body(&mut self) -> ::std::vec::Vec<u8> {
100         self.header_and_body.take().unwrap_or_else(|| ::std::vec::Vec::new())
101     }
102 
103     // required bytes signature = 2;
104 
signature(&self) -> &[u8]105     pub fn signature(&self) -> &[u8] {
106         match self.signature.as_ref() {
107             Some(v) => v,
108             None => &[],
109         }
110     }
111 
clear_signature(&mut self)112     pub fn clear_signature(&mut self) {
113         self.signature = ::std::option::Option::None;
114     }
115 
has_signature(&self) -> bool116     pub fn has_signature(&self) -> bool {
117         self.signature.is_some()
118     }
119 
120     // Param is passed by value, moved
set_signature(&mut self, v: ::std::vec::Vec<u8>)121     pub fn set_signature(&mut self, v: ::std::vec::Vec<u8>) {
122         self.signature = ::std::option::Option::Some(v);
123     }
124 
125     // Mutable pointer to the field.
126     // If field is not initialized, it is initialized with default value first.
mut_signature(&mut self) -> &mut ::std::vec::Vec<u8>127     pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec<u8> {
128         if self.signature.is_none() {
129             self.signature = ::std::option::Option::Some(::std::vec::Vec::new());
130         }
131         self.signature.as_mut().unwrap()
132     }
133 
134     // Take field
take_signature(&mut self) -> ::std::vec::Vec<u8>135     pub fn take_signature(&mut self) -> ::std::vec::Vec<u8> {
136         self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new())
137     }
138 }
139 
140 impl ::protobuf::Message for SecureMessage {
141     const NAME: &'static str = "SecureMessage";
142 
is_initialized(&self) -> bool143     fn is_initialized(&self) -> bool {
144         if self.header_and_body.is_none() {
145             return false;
146         }
147         if self.signature.is_none() {
148             return false;
149         }
150         true
151     }
152 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>153     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
154         while let Some(tag) = is.read_raw_tag_or_eof()? {
155             match tag {
156                 10 => {
157                     self.header_and_body = ::std::option::Option::Some(is.read_bytes()?);
158                 },
159                 18 => {
160                     self.signature = ::std::option::Option::Some(is.read_bytes()?);
161                 },
162                 tag => {
163                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
164                 },
165             };
166         }
167         ::std::result::Result::Ok(())
168     }
169 
170     // Compute sizes of nested messages
171     #[allow(unused_variables)]
compute_size(&self) -> u64172     fn compute_size(&self) -> u64 {
173         let mut my_size = 0;
174         if let Some(v) = self.header_and_body.as_ref() {
175             my_size += ::protobuf::rt::bytes_size(1, &v);
176         }
177         if let Some(v) = self.signature.as_ref() {
178             my_size += ::protobuf::rt::bytes_size(2, &v);
179         }
180         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
181         self.special_fields.cached_size().set(my_size as u32);
182         my_size
183     }
184 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>185     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
186         if let Some(v) = self.header_and_body.as_ref() {
187             os.write_bytes(1, v)?;
188         }
189         if let Some(v) = self.signature.as_ref() {
190             os.write_bytes(2, v)?;
191         }
192         os.write_unknown_fields(self.special_fields.unknown_fields())?;
193         ::std::result::Result::Ok(())
194     }
195 
special_fields(&self) -> &::protobuf::SpecialFields196     fn special_fields(&self) -> &::protobuf::SpecialFields {
197         &self.special_fields
198     }
199 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields200     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
201         &mut self.special_fields
202     }
203 
new() -> SecureMessage204     fn new() -> SecureMessage {
205         SecureMessage::new()
206     }
207 
clear(&mut self)208     fn clear(&mut self) {
209         self.header_and_body = ::std::option::Option::None;
210         self.signature = ::std::option::Option::None;
211         self.special_fields.clear();
212     }
213 
default_instance() -> &'static SecureMessage214     fn default_instance() -> &'static SecureMessage {
215         static instance: SecureMessage = SecureMessage {
216             header_and_body: ::std::option::Option::None,
217             signature: ::std::option::Option::None,
218             special_fields: ::protobuf::SpecialFields::new(),
219         };
220         &instance
221     }
222 }
223 
224 #[derive(PartialEq,Clone,Default,Debug)]
225 // @@protoc_insertion_point(message:securemessage.Header)
226 pub struct Header {
227     // message fields
228     // @@protoc_insertion_point(field:securemessage.Header.signature_scheme)
229     pub signature_scheme: ::std::option::Option<::protobuf::EnumOrUnknown<SigScheme>>,
230     // @@protoc_insertion_point(field:securemessage.Header.encryption_scheme)
231     pub encryption_scheme: ::std::option::Option<::protobuf::EnumOrUnknown<EncScheme>>,
232     // @@protoc_insertion_point(field:securemessage.Header.verification_key_id)
233     pub verification_key_id: ::std::option::Option<::std::vec::Vec<u8>>,
234     // @@protoc_insertion_point(field:securemessage.Header.decryption_key_id)
235     pub decryption_key_id: ::std::option::Option<::std::vec::Vec<u8>>,
236     // @@protoc_insertion_point(field:securemessage.Header.iv)
237     pub iv: ::std::option::Option<::std::vec::Vec<u8>>,
238     // @@protoc_insertion_point(field:securemessage.Header.public_metadata)
239     pub public_metadata: ::std::option::Option<::std::vec::Vec<u8>>,
240     // @@protoc_insertion_point(field:securemessage.Header.associated_data_length)
241     pub associated_data_length: ::std::option::Option<u32>,
242     // @@protoc_insertion_point(field:securemessage.Header.nonce)
243     pub nonce: ::std::option::Option<::std::vec::Vec<u8>>,
244     // special fields
245     // @@protoc_insertion_point(special_field:securemessage.Header.special_fields)
246     pub special_fields: ::protobuf::SpecialFields,
247 }
248 
249 impl<'a> ::std::default::Default for &'a Header {
default() -> &'a Header250     fn default() -> &'a Header {
251         <Header as ::protobuf::Message>::default_instance()
252     }
253 }
254 
255 impl Header {
new() -> Header256     pub fn new() -> Header {
257         ::std::default::Default::default()
258     }
259 
260     // required .securemessage.SigScheme signature_scheme = 1;
261 
signature_scheme(&self) -> SigScheme262     pub fn signature_scheme(&self) -> SigScheme {
263         match self.signature_scheme {
264             Some(e) => e.enum_value_or(SigScheme::HMAC_SHA256),
265             None => SigScheme::HMAC_SHA256,
266         }
267     }
268 
clear_signature_scheme(&mut self)269     pub fn clear_signature_scheme(&mut self) {
270         self.signature_scheme = ::std::option::Option::None;
271     }
272 
has_signature_scheme(&self) -> bool273     pub fn has_signature_scheme(&self) -> bool {
274         self.signature_scheme.is_some()
275     }
276 
277     // Param is passed by value, moved
set_signature_scheme(&mut self, v: SigScheme)278     pub fn set_signature_scheme(&mut self, v: SigScheme) {
279         self.signature_scheme = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
280     }
281 
282     // required .securemessage.EncScheme encryption_scheme = 2;
283 
encryption_scheme(&self) -> EncScheme284     pub fn encryption_scheme(&self) -> EncScheme {
285         match self.encryption_scheme {
286             Some(e) => e.enum_value_or(EncScheme::NONE),
287             None => EncScheme::NONE,
288         }
289     }
290 
clear_encryption_scheme(&mut self)291     pub fn clear_encryption_scheme(&mut self) {
292         self.encryption_scheme = ::std::option::Option::None;
293     }
294 
has_encryption_scheme(&self) -> bool295     pub fn has_encryption_scheme(&self) -> bool {
296         self.encryption_scheme.is_some()
297     }
298 
299     // Param is passed by value, moved
set_encryption_scheme(&mut self, v: EncScheme)300     pub fn set_encryption_scheme(&mut self, v: EncScheme) {
301         self.encryption_scheme = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
302     }
303 
304     // optional bytes verification_key_id = 3;
305 
verification_key_id(&self) -> &[u8]306     pub fn verification_key_id(&self) -> &[u8] {
307         match self.verification_key_id.as_ref() {
308             Some(v) => v,
309             None => &[],
310         }
311     }
312 
clear_verification_key_id(&mut self)313     pub fn clear_verification_key_id(&mut self) {
314         self.verification_key_id = ::std::option::Option::None;
315     }
316 
has_verification_key_id(&self) -> bool317     pub fn has_verification_key_id(&self) -> bool {
318         self.verification_key_id.is_some()
319     }
320 
321     // Param is passed by value, moved
set_verification_key_id(&mut self, v: ::std::vec::Vec<u8>)322     pub fn set_verification_key_id(&mut self, v: ::std::vec::Vec<u8>) {
323         self.verification_key_id = ::std::option::Option::Some(v);
324     }
325 
326     // Mutable pointer to the field.
327     // If field is not initialized, it is initialized with default value first.
mut_verification_key_id(&mut self) -> &mut ::std::vec::Vec<u8>328     pub fn mut_verification_key_id(&mut self) -> &mut ::std::vec::Vec<u8> {
329         if self.verification_key_id.is_none() {
330             self.verification_key_id = ::std::option::Option::Some(::std::vec::Vec::new());
331         }
332         self.verification_key_id.as_mut().unwrap()
333     }
334 
335     // Take field
take_verification_key_id(&mut self) -> ::std::vec::Vec<u8>336     pub fn take_verification_key_id(&mut self) -> ::std::vec::Vec<u8> {
337         self.verification_key_id.take().unwrap_or_else(|| ::std::vec::Vec::new())
338     }
339 
340     // optional bytes decryption_key_id = 4;
341 
decryption_key_id(&self) -> &[u8]342     pub fn decryption_key_id(&self) -> &[u8] {
343         match self.decryption_key_id.as_ref() {
344             Some(v) => v,
345             None => &[],
346         }
347     }
348 
clear_decryption_key_id(&mut self)349     pub fn clear_decryption_key_id(&mut self) {
350         self.decryption_key_id = ::std::option::Option::None;
351     }
352 
has_decryption_key_id(&self) -> bool353     pub fn has_decryption_key_id(&self) -> bool {
354         self.decryption_key_id.is_some()
355     }
356 
357     // Param is passed by value, moved
set_decryption_key_id(&mut self, v: ::std::vec::Vec<u8>)358     pub fn set_decryption_key_id(&mut self, v: ::std::vec::Vec<u8>) {
359         self.decryption_key_id = ::std::option::Option::Some(v);
360     }
361 
362     // Mutable pointer to the field.
363     // If field is not initialized, it is initialized with default value first.
mut_decryption_key_id(&mut self) -> &mut ::std::vec::Vec<u8>364     pub fn mut_decryption_key_id(&mut self) -> &mut ::std::vec::Vec<u8> {
365         if self.decryption_key_id.is_none() {
366             self.decryption_key_id = ::std::option::Option::Some(::std::vec::Vec::new());
367         }
368         self.decryption_key_id.as_mut().unwrap()
369     }
370 
371     // Take field
take_decryption_key_id(&mut self) -> ::std::vec::Vec<u8>372     pub fn take_decryption_key_id(&mut self) -> ::std::vec::Vec<u8> {
373         self.decryption_key_id.take().unwrap_or_else(|| ::std::vec::Vec::new())
374     }
375 
376     // optional bytes iv = 5;
377 
iv(&self) -> &[u8]378     pub fn iv(&self) -> &[u8] {
379         match self.iv.as_ref() {
380             Some(v) => v,
381             None => &[],
382         }
383     }
384 
clear_iv(&mut self)385     pub fn clear_iv(&mut self) {
386         self.iv = ::std::option::Option::None;
387     }
388 
has_iv(&self) -> bool389     pub fn has_iv(&self) -> bool {
390         self.iv.is_some()
391     }
392 
393     // Param is passed by value, moved
set_iv(&mut self, v: ::std::vec::Vec<u8>)394     pub fn set_iv(&mut self, v: ::std::vec::Vec<u8>) {
395         self.iv = ::std::option::Option::Some(v);
396     }
397 
398     // Mutable pointer to the field.
399     // If field is not initialized, it is initialized with default value first.
mut_iv(&mut self) -> &mut ::std::vec::Vec<u8>400     pub fn mut_iv(&mut self) -> &mut ::std::vec::Vec<u8> {
401         if self.iv.is_none() {
402             self.iv = ::std::option::Option::Some(::std::vec::Vec::new());
403         }
404         self.iv.as_mut().unwrap()
405     }
406 
407     // Take field
take_iv(&mut self) -> ::std::vec::Vec<u8>408     pub fn take_iv(&mut self) -> ::std::vec::Vec<u8> {
409         self.iv.take().unwrap_or_else(|| ::std::vec::Vec::new())
410     }
411 
412     // optional bytes public_metadata = 6;
413 
public_metadata(&self) -> &[u8]414     pub fn public_metadata(&self) -> &[u8] {
415         match self.public_metadata.as_ref() {
416             Some(v) => v,
417             None => &[],
418         }
419     }
420 
clear_public_metadata(&mut self)421     pub fn clear_public_metadata(&mut self) {
422         self.public_metadata = ::std::option::Option::None;
423     }
424 
has_public_metadata(&self) -> bool425     pub fn has_public_metadata(&self) -> bool {
426         self.public_metadata.is_some()
427     }
428 
429     // Param is passed by value, moved
set_public_metadata(&mut self, v: ::std::vec::Vec<u8>)430     pub fn set_public_metadata(&mut self, v: ::std::vec::Vec<u8>) {
431         self.public_metadata = ::std::option::Option::Some(v);
432     }
433 
434     // Mutable pointer to the field.
435     // If field is not initialized, it is initialized with default value first.
mut_public_metadata(&mut self) -> &mut ::std::vec::Vec<u8>436     pub fn mut_public_metadata(&mut self) -> &mut ::std::vec::Vec<u8> {
437         if self.public_metadata.is_none() {
438             self.public_metadata = ::std::option::Option::Some(::std::vec::Vec::new());
439         }
440         self.public_metadata.as_mut().unwrap()
441     }
442 
443     // Take field
take_public_metadata(&mut self) -> ::std::vec::Vec<u8>444     pub fn take_public_metadata(&mut self) -> ::std::vec::Vec<u8> {
445         self.public_metadata.take().unwrap_or_else(|| ::std::vec::Vec::new())
446     }
447 
448     // optional uint32 associated_data_length = 7;
449 
associated_data_length(&self) -> u32450     pub fn associated_data_length(&self) -> u32 {
451         self.associated_data_length.unwrap_or(0u32)
452     }
453 
clear_associated_data_length(&mut self)454     pub fn clear_associated_data_length(&mut self) {
455         self.associated_data_length = ::std::option::Option::None;
456     }
457 
has_associated_data_length(&self) -> bool458     pub fn has_associated_data_length(&self) -> bool {
459         self.associated_data_length.is_some()
460     }
461 
462     // Param is passed by value, moved
set_associated_data_length(&mut self, v: u32)463     pub fn set_associated_data_length(&mut self, v: u32) {
464         self.associated_data_length = ::std::option::Option::Some(v);
465     }
466 
467     // optional bytes nonce = 8;
468 
nonce(&self) -> &[u8]469     pub fn nonce(&self) -> &[u8] {
470         match self.nonce.as_ref() {
471             Some(v) => v,
472             None => &[],
473         }
474     }
475 
clear_nonce(&mut self)476     pub fn clear_nonce(&mut self) {
477         self.nonce = ::std::option::Option::None;
478     }
479 
has_nonce(&self) -> bool480     pub fn has_nonce(&self) -> bool {
481         self.nonce.is_some()
482     }
483 
484     // Param is passed by value, moved
set_nonce(&mut self, v: ::std::vec::Vec<u8>)485     pub fn set_nonce(&mut self, v: ::std::vec::Vec<u8>) {
486         self.nonce = ::std::option::Option::Some(v);
487     }
488 
489     // Mutable pointer to the field.
490     // If field is not initialized, it is initialized with default value first.
mut_nonce(&mut self) -> &mut ::std::vec::Vec<u8>491     pub fn mut_nonce(&mut self) -> &mut ::std::vec::Vec<u8> {
492         if self.nonce.is_none() {
493             self.nonce = ::std::option::Option::Some(::std::vec::Vec::new());
494         }
495         self.nonce.as_mut().unwrap()
496     }
497 
498     // Take field
take_nonce(&mut self) -> ::std::vec::Vec<u8>499     pub fn take_nonce(&mut self) -> ::std::vec::Vec<u8> {
500         self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new())
501     }
502 }
503 
504 impl ::protobuf::Message for Header {
505     const NAME: &'static str = "Header";
506 
is_initialized(&self) -> bool507     fn is_initialized(&self) -> bool {
508         if self.signature_scheme.is_none() {
509             return false;
510         }
511         if self.encryption_scheme.is_none() {
512             return false;
513         }
514         true
515     }
516 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>517     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
518         while let Some(tag) = is.read_raw_tag_or_eof()? {
519             match tag {
520                 8 => {
521                     self.signature_scheme = ::std::option::Option::Some(is.read_enum_or_unknown()?);
522                 },
523                 16 => {
524                     self.encryption_scheme = ::std::option::Option::Some(is.read_enum_or_unknown()?);
525                 },
526                 26 => {
527                     self.verification_key_id = ::std::option::Option::Some(is.read_bytes()?);
528                 },
529                 34 => {
530                     self.decryption_key_id = ::std::option::Option::Some(is.read_bytes()?);
531                 },
532                 42 => {
533                     self.iv = ::std::option::Option::Some(is.read_bytes()?);
534                 },
535                 50 => {
536                     self.public_metadata = ::std::option::Option::Some(is.read_bytes()?);
537                 },
538                 56 => {
539                     self.associated_data_length = ::std::option::Option::Some(is.read_uint32()?);
540                 },
541                 66 => {
542                     self.nonce = ::std::option::Option::Some(is.read_bytes()?);
543                 },
544                 tag => {
545                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
546                 },
547             };
548         }
549         ::std::result::Result::Ok(())
550     }
551 
552     // Compute sizes of nested messages
553     #[allow(unused_variables)]
compute_size(&self) -> u64554     fn compute_size(&self) -> u64 {
555         let mut my_size = 0;
556         if let Some(v) = self.signature_scheme {
557             my_size += ::protobuf::rt::int32_size(1, v.value());
558         }
559         if let Some(v) = self.encryption_scheme {
560             my_size += ::protobuf::rt::int32_size(2, v.value());
561         }
562         if let Some(v) = self.verification_key_id.as_ref() {
563             my_size += ::protobuf::rt::bytes_size(3, &v);
564         }
565         if let Some(v) = self.decryption_key_id.as_ref() {
566             my_size += ::protobuf::rt::bytes_size(4, &v);
567         }
568         if let Some(v) = self.iv.as_ref() {
569             my_size += ::protobuf::rt::bytes_size(5, &v);
570         }
571         if let Some(v) = self.public_metadata.as_ref() {
572             my_size += ::protobuf::rt::bytes_size(6, &v);
573         }
574         if let Some(v) = self.associated_data_length {
575             my_size += ::protobuf::rt::uint32_size(7, v);
576         }
577         if let Some(v) = self.nonce.as_ref() {
578             my_size += ::protobuf::rt::bytes_size(8, &v);
579         }
580         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
581         self.special_fields.cached_size().set(my_size as u32);
582         my_size
583     }
584 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>585     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
586         if let Some(v) = self.signature_scheme {
587             os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
588         }
589         if let Some(v) = self.encryption_scheme {
590             os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?;
591         }
592         if let Some(v) = self.verification_key_id.as_ref() {
593             os.write_bytes(3, v)?;
594         }
595         if let Some(v) = self.decryption_key_id.as_ref() {
596             os.write_bytes(4, v)?;
597         }
598         if let Some(v) = self.iv.as_ref() {
599             os.write_bytes(5, v)?;
600         }
601         if let Some(v) = self.public_metadata.as_ref() {
602             os.write_bytes(6, v)?;
603         }
604         if let Some(v) = self.associated_data_length {
605             os.write_uint32(7, v)?;
606         }
607         if let Some(v) = self.nonce.as_ref() {
608             os.write_bytes(8, v)?;
609         }
610         os.write_unknown_fields(self.special_fields.unknown_fields())?;
611         ::std::result::Result::Ok(())
612     }
613 
special_fields(&self) -> &::protobuf::SpecialFields614     fn special_fields(&self) -> &::protobuf::SpecialFields {
615         &self.special_fields
616     }
617 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields618     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
619         &mut self.special_fields
620     }
621 
new() -> Header622     fn new() -> Header {
623         Header::new()
624     }
625 
clear(&mut self)626     fn clear(&mut self) {
627         self.signature_scheme = ::std::option::Option::None;
628         self.encryption_scheme = ::std::option::Option::None;
629         self.verification_key_id = ::std::option::Option::None;
630         self.decryption_key_id = ::std::option::Option::None;
631         self.iv = ::std::option::Option::None;
632         self.public_metadata = ::std::option::Option::None;
633         self.associated_data_length = ::std::option::Option::None;
634         self.nonce = ::std::option::Option::None;
635         self.special_fields.clear();
636     }
637 
default_instance() -> &'static Header638     fn default_instance() -> &'static Header {
639         static instance: Header = Header {
640             signature_scheme: ::std::option::Option::None,
641             encryption_scheme: ::std::option::Option::None,
642             verification_key_id: ::std::option::Option::None,
643             decryption_key_id: ::std::option::Option::None,
644             iv: ::std::option::Option::None,
645             public_metadata: ::std::option::Option::None,
646             associated_data_length: ::std::option::Option::None,
647             nonce: ::std::option::Option::None,
648             special_fields: ::protobuf::SpecialFields::new(),
649         };
650         &instance
651     }
652 }
653 
654 #[derive(PartialEq,Clone,Default,Debug)]
655 // @@protoc_insertion_point(message:securemessage.HeaderAndBody)
656 pub struct HeaderAndBody {
657     // message fields
658     // @@protoc_insertion_point(field:securemessage.HeaderAndBody.header)
659     pub header: ::protobuf::MessageField<Header>,
660     // @@protoc_insertion_point(field:securemessage.HeaderAndBody.body)
661     pub body: ::std::option::Option<::std::vec::Vec<u8>>,
662     // special fields
663     // @@protoc_insertion_point(special_field:securemessage.HeaderAndBody.special_fields)
664     pub special_fields: ::protobuf::SpecialFields,
665 }
666 
667 impl<'a> ::std::default::Default for &'a HeaderAndBody {
default() -> &'a HeaderAndBody668     fn default() -> &'a HeaderAndBody {
669         <HeaderAndBody as ::protobuf::Message>::default_instance()
670     }
671 }
672 
673 impl HeaderAndBody {
new() -> HeaderAndBody674     pub fn new() -> HeaderAndBody {
675         ::std::default::Default::default()
676     }
677 
678     // required bytes body = 2;
679 
body(&self) -> &[u8]680     pub fn body(&self) -> &[u8] {
681         match self.body.as_ref() {
682             Some(v) => v,
683             None => &[],
684         }
685     }
686 
clear_body(&mut self)687     pub fn clear_body(&mut self) {
688         self.body = ::std::option::Option::None;
689     }
690 
has_body(&self) -> bool691     pub fn has_body(&self) -> bool {
692         self.body.is_some()
693     }
694 
695     // Param is passed by value, moved
set_body(&mut self, v: ::std::vec::Vec<u8>)696     pub fn set_body(&mut self, v: ::std::vec::Vec<u8>) {
697         self.body = ::std::option::Option::Some(v);
698     }
699 
700     // Mutable pointer to the field.
701     // If field is not initialized, it is initialized with default value first.
mut_body(&mut self) -> &mut ::std::vec::Vec<u8>702     pub fn mut_body(&mut self) -> &mut ::std::vec::Vec<u8> {
703         if self.body.is_none() {
704             self.body = ::std::option::Option::Some(::std::vec::Vec::new());
705         }
706         self.body.as_mut().unwrap()
707     }
708 
709     // Take field
take_body(&mut self) -> ::std::vec::Vec<u8>710     pub fn take_body(&mut self) -> ::std::vec::Vec<u8> {
711         self.body.take().unwrap_or_else(|| ::std::vec::Vec::new())
712     }
713 }
714 
715 impl ::protobuf::Message for HeaderAndBody {
716     const NAME: &'static str = "HeaderAndBody";
717 
is_initialized(&self) -> bool718     fn is_initialized(&self) -> bool {
719         if self.header.is_none() {
720             return false;
721         }
722         if self.body.is_none() {
723             return false;
724         }
725         for v in &self.header {
726             if !v.is_initialized() {
727                 return false;
728             }
729         };
730         true
731     }
732 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>733     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
734         while let Some(tag) = is.read_raw_tag_or_eof()? {
735             match tag {
736                 10 => {
737                     ::protobuf::rt::read_singular_message_into_field(is, &mut self.header)?;
738                 },
739                 18 => {
740                     self.body = ::std::option::Option::Some(is.read_bytes()?);
741                 },
742                 tag => {
743                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
744                 },
745             };
746         }
747         ::std::result::Result::Ok(())
748     }
749 
750     // Compute sizes of nested messages
751     #[allow(unused_variables)]
compute_size(&self) -> u64752     fn compute_size(&self) -> u64 {
753         let mut my_size = 0;
754         if let Some(v) = self.header.as_ref() {
755             let len = v.compute_size();
756             my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
757         }
758         if let Some(v) = self.body.as_ref() {
759             my_size += ::protobuf::rt::bytes_size(2, &v);
760         }
761         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
762         self.special_fields.cached_size().set(my_size as u32);
763         my_size
764     }
765 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>766     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
767         if let Some(v) = self.header.as_ref() {
768             ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
769         }
770         if let Some(v) = self.body.as_ref() {
771             os.write_bytes(2, v)?;
772         }
773         os.write_unknown_fields(self.special_fields.unknown_fields())?;
774         ::std::result::Result::Ok(())
775     }
776 
special_fields(&self) -> &::protobuf::SpecialFields777     fn special_fields(&self) -> &::protobuf::SpecialFields {
778         &self.special_fields
779     }
780 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields781     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
782         &mut self.special_fields
783     }
784 
new() -> HeaderAndBody785     fn new() -> HeaderAndBody {
786         HeaderAndBody::new()
787     }
788 
clear(&mut self)789     fn clear(&mut self) {
790         self.header.clear();
791         self.body = ::std::option::Option::None;
792         self.special_fields.clear();
793     }
794 
default_instance() -> &'static HeaderAndBody795     fn default_instance() -> &'static HeaderAndBody {
796         static instance: HeaderAndBody = HeaderAndBody {
797             header: ::protobuf::MessageField::none(),
798             body: ::std::option::Option::None,
799             special_fields: ::protobuf::SpecialFields::new(),
800         };
801         &instance
802     }
803 }
804 
805 #[derive(PartialEq,Clone,Default,Debug)]
806 // @@protoc_insertion_point(message:securemessage.HeaderAndBodyInternal)
807 pub struct HeaderAndBodyInternal {
808     // message fields
809     // @@protoc_insertion_point(field:securemessage.HeaderAndBodyInternal.header)
810     pub header: ::std::option::Option<::std::vec::Vec<u8>>,
811     // @@protoc_insertion_point(field:securemessage.HeaderAndBodyInternal.body)
812     pub body: ::std::option::Option<::std::vec::Vec<u8>>,
813     // special fields
814     // @@protoc_insertion_point(special_field:securemessage.HeaderAndBodyInternal.special_fields)
815     pub special_fields: ::protobuf::SpecialFields,
816 }
817 
818 impl<'a> ::std::default::Default for &'a HeaderAndBodyInternal {
default() -> &'a HeaderAndBodyInternal819     fn default() -> &'a HeaderAndBodyInternal {
820         <HeaderAndBodyInternal as ::protobuf::Message>::default_instance()
821     }
822 }
823 
824 impl HeaderAndBodyInternal {
new() -> HeaderAndBodyInternal825     pub fn new() -> HeaderAndBodyInternal {
826         ::std::default::Default::default()
827     }
828 
829     // required bytes header = 1;
830 
header(&self) -> &[u8]831     pub fn header(&self) -> &[u8] {
832         match self.header.as_ref() {
833             Some(v) => v,
834             None => &[],
835         }
836     }
837 
clear_header(&mut self)838     pub fn clear_header(&mut self) {
839         self.header = ::std::option::Option::None;
840     }
841 
has_header(&self) -> bool842     pub fn has_header(&self) -> bool {
843         self.header.is_some()
844     }
845 
846     // Param is passed by value, moved
set_header(&mut self, v: ::std::vec::Vec<u8>)847     pub fn set_header(&mut self, v: ::std::vec::Vec<u8>) {
848         self.header = ::std::option::Option::Some(v);
849     }
850 
851     // Mutable pointer to the field.
852     // If field is not initialized, it is initialized with default value first.
mut_header(&mut self) -> &mut ::std::vec::Vec<u8>853     pub fn mut_header(&mut self) -> &mut ::std::vec::Vec<u8> {
854         if self.header.is_none() {
855             self.header = ::std::option::Option::Some(::std::vec::Vec::new());
856         }
857         self.header.as_mut().unwrap()
858     }
859 
860     // Take field
take_header(&mut self) -> ::std::vec::Vec<u8>861     pub fn take_header(&mut self) -> ::std::vec::Vec<u8> {
862         self.header.take().unwrap_or_else(|| ::std::vec::Vec::new())
863     }
864 
865     // required bytes body = 2;
866 
body(&self) -> &[u8]867     pub fn body(&self) -> &[u8] {
868         match self.body.as_ref() {
869             Some(v) => v,
870             None => &[],
871         }
872     }
873 
clear_body(&mut self)874     pub fn clear_body(&mut self) {
875         self.body = ::std::option::Option::None;
876     }
877 
has_body(&self) -> bool878     pub fn has_body(&self) -> bool {
879         self.body.is_some()
880     }
881 
882     // Param is passed by value, moved
set_body(&mut self, v: ::std::vec::Vec<u8>)883     pub fn set_body(&mut self, v: ::std::vec::Vec<u8>) {
884         self.body = ::std::option::Option::Some(v);
885     }
886 
887     // Mutable pointer to the field.
888     // If field is not initialized, it is initialized with default value first.
mut_body(&mut self) -> &mut ::std::vec::Vec<u8>889     pub fn mut_body(&mut self) -> &mut ::std::vec::Vec<u8> {
890         if self.body.is_none() {
891             self.body = ::std::option::Option::Some(::std::vec::Vec::new());
892         }
893         self.body.as_mut().unwrap()
894     }
895 
896     // Take field
take_body(&mut self) -> ::std::vec::Vec<u8>897     pub fn take_body(&mut self) -> ::std::vec::Vec<u8> {
898         self.body.take().unwrap_or_else(|| ::std::vec::Vec::new())
899     }
900 }
901 
902 impl ::protobuf::Message for HeaderAndBodyInternal {
903     const NAME: &'static str = "HeaderAndBodyInternal";
904 
is_initialized(&self) -> bool905     fn is_initialized(&self) -> bool {
906         if self.header.is_none() {
907             return false;
908         }
909         if self.body.is_none() {
910             return false;
911         }
912         true
913     }
914 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>915     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
916         while let Some(tag) = is.read_raw_tag_or_eof()? {
917             match tag {
918                 10 => {
919                     self.header = ::std::option::Option::Some(is.read_bytes()?);
920                 },
921                 18 => {
922                     self.body = ::std::option::Option::Some(is.read_bytes()?);
923                 },
924                 tag => {
925                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
926                 },
927             };
928         }
929         ::std::result::Result::Ok(())
930     }
931 
932     // Compute sizes of nested messages
933     #[allow(unused_variables)]
compute_size(&self) -> u64934     fn compute_size(&self) -> u64 {
935         let mut my_size = 0;
936         if let Some(v) = self.header.as_ref() {
937             my_size += ::protobuf::rt::bytes_size(1, &v);
938         }
939         if let Some(v) = self.body.as_ref() {
940             my_size += ::protobuf::rt::bytes_size(2, &v);
941         }
942         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
943         self.special_fields.cached_size().set(my_size as u32);
944         my_size
945     }
946 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>947     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
948         if let Some(v) = self.header.as_ref() {
949             os.write_bytes(1, v)?;
950         }
951         if let Some(v) = self.body.as_ref() {
952             os.write_bytes(2, v)?;
953         }
954         os.write_unknown_fields(self.special_fields.unknown_fields())?;
955         ::std::result::Result::Ok(())
956     }
957 
special_fields(&self) -> &::protobuf::SpecialFields958     fn special_fields(&self) -> &::protobuf::SpecialFields {
959         &self.special_fields
960     }
961 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields962     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
963         &mut self.special_fields
964     }
965 
new() -> HeaderAndBodyInternal966     fn new() -> HeaderAndBodyInternal {
967         HeaderAndBodyInternal::new()
968     }
969 
clear(&mut self)970     fn clear(&mut self) {
971         self.header = ::std::option::Option::None;
972         self.body = ::std::option::Option::None;
973         self.special_fields.clear();
974     }
975 
default_instance() -> &'static HeaderAndBodyInternal976     fn default_instance() -> &'static HeaderAndBodyInternal {
977         static instance: HeaderAndBodyInternal = HeaderAndBodyInternal {
978             header: ::std::option::Option::None,
979             body: ::std::option::Option::None,
980             special_fields: ::protobuf::SpecialFields::new(),
981         };
982         &instance
983     }
984 }
985 
986 #[derive(PartialEq,Clone,Default,Debug)]
987 // @@protoc_insertion_point(message:securemessage.EcP256PublicKey)
988 pub struct EcP256PublicKey {
989     // message fields
990     // @@protoc_insertion_point(field:securemessage.EcP256PublicKey.x)
991     pub x: ::std::option::Option<::std::vec::Vec<u8>>,
992     // @@protoc_insertion_point(field:securemessage.EcP256PublicKey.y)
993     pub y: ::std::option::Option<::std::vec::Vec<u8>>,
994     // special fields
995     // @@protoc_insertion_point(special_field:securemessage.EcP256PublicKey.special_fields)
996     pub special_fields: ::protobuf::SpecialFields,
997 }
998 
999 impl<'a> ::std::default::Default for &'a EcP256PublicKey {
default() -> &'a EcP256PublicKey1000     fn default() -> &'a EcP256PublicKey {
1001         <EcP256PublicKey as ::protobuf::Message>::default_instance()
1002     }
1003 }
1004 
1005 impl EcP256PublicKey {
new() -> EcP256PublicKey1006     pub fn new() -> EcP256PublicKey {
1007         ::std::default::Default::default()
1008     }
1009 
1010     // required bytes x = 1;
1011 
x(&self) -> &[u8]1012     pub fn x(&self) -> &[u8] {
1013         match self.x.as_ref() {
1014             Some(v) => v,
1015             None => &[],
1016         }
1017     }
1018 
clear_x(&mut self)1019     pub fn clear_x(&mut self) {
1020         self.x = ::std::option::Option::None;
1021     }
1022 
has_x(&self) -> bool1023     pub fn has_x(&self) -> bool {
1024         self.x.is_some()
1025     }
1026 
1027     // Param is passed by value, moved
set_x(&mut self, v: ::std::vec::Vec<u8>)1028     pub fn set_x(&mut self, v: ::std::vec::Vec<u8>) {
1029         self.x = ::std::option::Option::Some(v);
1030     }
1031 
1032     // Mutable pointer to the field.
1033     // If field is not initialized, it is initialized with default value first.
mut_x(&mut self) -> &mut ::std::vec::Vec<u8>1034     pub fn mut_x(&mut self) -> &mut ::std::vec::Vec<u8> {
1035         if self.x.is_none() {
1036             self.x = ::std::option::Option::Some(::std::vec::Vec::new());
1037         }
1038         self.x.as_mut().unwrap()
1039     }
1040 
1041     // Take field
take_x(&mut self) -> ::std::vec::Vec<u8>1042     pub fn take_x(&mut self) -> ::std::vec::Vec<u8> {
1043         self.x.take().unwrap_or_else(|| ::std::vec::Vec::new())
1044     }
1045 
1046     // required bytes y = 2;
1047 
y(&self) -> &[u8]1048     pub fn y(&self) -> &[u8] {
1049         match self.y.as_ref() {
1050             Some(v) => v,
1051             None => &[],
1052         }
1053     }
1054 
clear_y(&mut self)1055     pub fn clear_y(&mut self) {
1056         self.y = ::std::option::Option::None;
1057     }
1058 
has_y(&self) -> bool1059     pub fn has_y(&self) -> bool {
1060         self.y.is_some()
1061     }
1062 
1063     // Param is passed by value, moved
set_y(&mut self, v: ::std::vec::Vec<u8>)1064     pub fn set_y(&mut self, v: ::std::vec::Vec<u8>) {
1065         self.y = ::std::option::Option::Some(v);
1066     }
1067 
1068     // Mutable pointer to the field.
1069     // If field is not initialized, it is initialized with default value first.
mut_y(&mut self) -> &mut ::std::vec::Vec<u8>1070     pub fn mut_y(&mut self) -> &mut ::std::vec::Vec<u8> {
1071         if self.y.is_none() {
1072             self.y = ::std::option::Option::Some(::std::vec::Vec::new());
1073         }
1074         self.y.as_mut().unwrap()
1075     }
1076 
1077     // Take field
take_y(&mut self) -> ::std::vec::Vec<u8>1078     pub fn take_y(&mut self) -> ::std::vec::Vec<u8> {
1079         self.y.take().unwrap_or_else(|| ::std::vec::Vec::new())
1080     }
1081 }
1082 
1083 impl ::protobuf::Message for EcP256PublicKey {
1084     const NAME: &'static str = "EcP256PublicKey";
1085 
is_initialized(&self) -> bool1086     fn is_initialized(&self) -> bool {
1087         if self.x.is_none() {
1088             return false;
1089         }
1090         if self.y.is_none() {
1091             return false;
1092         }
1093         true
1094     }
1095 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>1096     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
1097         while let Some(tag) = is.read_raw_tag_or_eof()? {
1098             match tag {
1099                 10 => {
1100                     self.x = ::std::option::Option::Some(is.read_bytes()?);
1101                 },
1102                 18 => {
1103                     self.y = ::std::option::Option::Some(is.read_bytes()?);
1104                 },
1105                 tag => {
1106                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
1107                 },
1108             };
1109         }
1110         ::std::result::Result::Ok(())
1111     }
1112 
1113     // Compute sizes of nested messages
1114     #[allow(unused_variables)]
compute_size(&self) -> u641115     fn compute_size(&self) -> u64 {
1116         let mut my_size = 0;
1117         if let Some(v) = self.x.as_ref() {
1118             my_size += ::protobuf::rt::bytes_size(1, &v);
1119         }
1120         if let Some(v) = self.y.as_ref() {
1121             my_size += ::protobuf::rt::bytes_size(2, &v);
1122         }
1123         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
1124         self.special_fields.cached_size().set(my_size as u32);
1125         my_size
1126     }
1127 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>1128     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
1129         if let Some(v) = self.x.as_ref() {
1130             os.write_bytes(1, v)?;
1131         }
1132         if let Some(v) = self.y.as_ref() {
1133             os.write_bytes(2, v)?;
1134         }
1135         os.write_unknown_fields(self.special_fields.unknown_fields())?;
1136         ::std::result::Result::Ok(())
1137     }
1138 
special_fields(&self) -> &::protobuf::SpecialFields1139     fn special_fields(&self) -> &::protobuf::SpecialFields {
1140         &self.special_fields
1141     }
1142 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields1143     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
1144         &mut self.special_fields
1145     }
1146 
new() -> EcP256PublicKey1147     fn new() -> EcP256PublicKey {
1148         EcP256PublicKey::new()
1149     }
1150 
clear(&mut self)1151     fn clear(&mut self) {
1152         self.x = ::std::option::Option::None;
1153         self.y = ::std::option::Option::None;
1154         self.special_fields.clear();
1155     }
1156 
default_instance() -> &'static EcP256PublicKey1157     fn default_instance() -> &'static EcP256PublicKey {
1158         static instance: EcP256PublicKey = EcP256PublicKey {
1159             x: ::std::option::Option::None,
1160             y: ::std::option::Option::None,
1161             special_fields: ::protobuf::SpecialFields::new(),
1162         };
1163         &instance
1164     }
1165 }
1166 
1167 #[derive(PartialEq,Clone,Default,Debug)]
1168 // @@protoc_insertion_point(message:securemessage.SimpleRsaPublicKey)
1169 pub struct SimpleRsaPublicKey {
1170     // message fields
1171     // @@protoc_insertion_point(field:securemessage.SimpleRsaPublicKey.n)
1172     pub n: ::std::option::Option<::std::vec::Vec<u8>>,
1173     // @@protoc_insertion_point(field:securemessage.SimpleRsaPublicKey.e)
1174     pub e: ::std::option::Option<i32>,
1175     // special fields
1176     // @@protoc_insertion_point(special_field:securemessage.SimpleRsaPublicKey.special_fields)
1177     pub special_fields: ::protobuf::SpecialFields,
1178 }
1179 
1180 impl<'a> ::std::default::Default for &'a SimpleRsaPublicKey {
default() -> &'a SimpleRsaPublicKey1181     fn default() -> &'a SimpleRsaPublicKey {
1182         <SimpleRsaPublicKey as ::protobuf::Message>::default_instance()
1183     }
1184 }
1185 
1186 impl SimpleRsaPublicKey {
new() -> SimpleRsaPublicKey1187     pub fn new() -> SimpleRsaPublicKey {
1188         ::std::default::Default::default()
1189     }
1190 
1191     // required bytes n = 1;
1192 
n(&self) -> &[u8]1193     pub fn n(&self) -> &[u8] {
1194         match self.n.as_ref() {
1195             Some(v) => v,
1196             None => &[],
1197         }
1198     }
1199 
clear_n(&mut self)1200     pub fn clear_n(&mut self) {
1201         self.n = ::std::option::Option::None;
1202     }
1203 
has_n(&self) -> bool1204     pub fn has_n(&self) -> bool {
1205         self.n.is_some()
1206     }
1207 
1208     // Param is passed by value, moved
set_n(&mut self, v: ::std::vec::Vec<u8>)1209     pub fn set_n(&mut self, v: ::std::vec::Vec<u8>) {
1210         self.n = ::std::option::Option::Some(v);
1211     }
1212 
1213     // Mutable pointer to the field.
1214     // If field is not initialized, it is initialized with default value first.
mut_n(&mut self) -> &mut ::std::vec::Vec<u8>1215     pub fn mut_n(&mut self) -> &mut ::std::vec::Vec<u8> {
1216         if self.n.is_none() {
1217             self.n = ::std::option::Option::Some(::std::vec::Vec::new());
1218         }
1219         self.n.as_mut().unwrap()
1220     }
1221 
1222     // Take field
take_n(&mut self) -> ::std::vec::Vec<u8>1223     pub fn take_n(&mut self) -> ::std::vec::Vec<u8> {
1224         self.n.take().unwrap_or_else(|| ::std::vec::Vec::new())
1225     }
1226 
1227     // optional int32 e = 2;
1228 
e(&self) -> i321229     pub fn e(&self) -> i32 {
1230         self.e.unwrap_or(65537i32)
1231     }
1232 
clear_e(&mut self)1233     pub fn clear_e(&mut self) {
1234         self.e = ::std::option::Option::None;
1235     }
1236 
has_e(&self) -> bool1237     pub fn has_e(&self) -> bool {
1238         self.e.is_some()
1239     }
1240 
1241     // Param is passed by value, moved
set_e(&mut self, v: i32)1242     pub fn set_e(&mut self, v: i32) {
1243         self.e = ::std::option::Option::Some(v);
1244     }
1245 }
1246 
1247 impl ::protobuf::Message for SimpleRsaPublicKey {
1248     const NAME: &'static str = "SimpleRsaPublicKey";
1249 
is_initialized(&self) -> bool1250     fn is_initialized(&self) -> bool {
1251         if self.n.is_none() {
1252             return false;
1253         }
1254         true
1255     }
1256 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>1257     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
1258         while let Some(tag) = is.read_raw_tag_or_eof()? {
1259             match tag {
1260                 10 => {
1261                     self.n = ::std::option::Option::Some(is.read_bytes()?);
1262                 },
1263                 16 => {
1264                     self.e = ::std::option::Option::Some(is.read_int32()?);
1265                 },
1266                 tag => {
1267                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
1268                 },
1269             };
1270         }
1271         ::std::result::Result::Ok(())
1272     }
1273 
1274     // Compute sizes of nested messages
1275     #[allow(unused_variables)]
compute_size(&self) -> u641276     fn compute_size(&self) -> u64 {
1277         let mut my_size = 0;
1278         if let Some(v) = self.n.as_ref() {
1279             my_size += ::protobuf::rt::bytes_size(1, &v);
1280         }
1281         if let Some(v) = self.e {
1282             my_size += ::protobuf::rt::int32_size(2, v);
1283         }
1284         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
1285         self.special_fields.cached_size().set(my_size as u32);
1286         my_size
1287     }
1288 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>1289     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
1290         if let Some(v) = self.n.as_ref() {
1291             os.write_bytes(1, v)?;
1292         }
1293         if let Some(v) = self.e {
1294             os.write_int32(2, v)?;
1295         }
1296         os.write_unknown_fields(self.special_fields.unknown_fields())?;
1297         ::std::result::Result::Ok(())
1298     }
1299 
special_fields(&self) -> &::protobuf::SpecialFields1300     fn special_fields(&self) -> &::protobuf::SpecialFields {
1301         &self.special_fields
1302     }
1303 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields1304     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
1305         &mut self.special_fields
1306     }
1307 
new() -> SimpleRsaPublicKey1308     fn new() -> SimpleRsaPublicKey {
1309         SimpleRsaPublicKey::new()
1310     }
1311 
clear(&mut self)1312     fn clear(&mut self) {
1313         self.n = ::std::option::Option::None;
1314         self.e = ::std::option::Option::None;
1315         self.special_fields.clear();
1316     }
1317 
default_instance() -> &'static SimpleRsaPublicKey1318     fn default_instance() -> &'static SimpleRsaPublicKey {
1319         static instance: SimpleRsaPublicKey = SimpleRsaPublicKey {
1320             n: ::std::option::Option::None,
1321             e: ::std::option::Option::None,
1322             special_fields: ::protobuf::SpecialFields::new(),
1323         };
1324         &instance
1325     }
1326 }
1327 
1328 #[derive(PartialEq,Clone,Default,Debug)]
1329 // @@protoc_insertion_point(message:securemessage.DhPublicKey)
1330 pub struct DhPublicKey {
1331     // message fields
1332     // @@protoc_insertion_point(field:securemessage.DhPublicKey.y)
1333     pub y: ::std::option::Option<::std::vec::Vec<u8>>,
1334     // special fields
1335     // @@protoc_insertion_point(special_field:securemessage.DhPublicKey.special_fields)
1336     pub special_fields: ::protobuf::SpecialFields,
1337 }
1338 
1339 impl<'a> ::std::default::Default for &'a DhPublicKey {
default() -> &'a DhPublicKey1340     fn default() -> &'a DhPublicKey {
1341         <DhPublicKey as ::protobuf::Message>::default_instance()
1342     }
1343 }
1344 
1345 impl DhPublicKey {
new() -> DhPublicKey1346     pub fn new() -> DhPublicKey {
1347         ::std::default::Default::default()
1348     }
1349 
1350     // required bytes y = 1;
1351 
y(&self) -> &[u8]1352     pub fn y(&self) -> &[u8] {
1353         match self.y.as_ref() {
1354             Some(v) => v,
1355             None => &[],
1356         }
1357     }
1358 
clear_y(&mut self)1359     pub fn clear_y(&mut self) {
1360         self.y = ::std::option::Option::None;
1361     }
1362 
has_y(&self) -> bool1363     pub fn has_y(&self) -> bool {
1364         self.y.is_some()
1365     }
1366 
1367     // Param is passed by value, moved
set_y(&mut self, v: ::std::vec::Vec<u8>)1368     pub fn set_y(&mut self, v: ::std::vec::Vec<u8>) {
1369         self.y = ::std::option::Option::Some(v);
1370     }
1371 
1372     // Mutable pointer to the field.
1373     // If field is not initialized, it is initialized with default value first.
mut_y(&mut self) -> &mut ::std::vec::Vec<u8>1374     pub fn mut_y(&mut self) -> &mut ::std::vec::Vec<u8> {
1375         if self.y.is_none() {
1376             self.y = ::std::option::Option::Some(::std::vec::Vec::new());
1377         }
1378         self.y.as_mut().unwrap()
1379     }
1380 
1381     // Take field
take_y(&mut self) -> ::std::vec::Vec<u8>1382     pub fn take_y(&mut self) -> ::std::vec::Vec<u8> {
1383         self.y.take().unwrap_or_else(|| ::std::vec::Vec::new())
1384     }
1385 }
1386 
1387 impl ::protobuf::Message for DhPublicKey {
1388     const NAME: &'static str = "DhPublicKey";
1389 
is_initialized(&self) -> bool1390     fn is_initialized(&self) -> bool {
1391         if self.y.is_none() {
1392             return false;
1393         }
1394         true
1395     }
1396 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>1397     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
1398         while let Some(tag) = is.read_raw_tag_or_eof()? {
1399             match tag {
1400                 10 => {
1401                     self.y = ::std::option::Option::Some(is.read_bytes()?);
1402                 },
1403                 tag => {
1404                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
1405                 },
1406             };
1407         }
1408         ::std::result::Result::Ok(())
1409     }
1410 
1411     // Compute sizes of nested messages
1412     #[allow(unused_variables)]
compute_size(&self) -> u641413     fn compute_size(&self) -> u64 {
1414         let mut my_size = 0;
1415         if let Some(v) = self.y.as_ref() {
1416             my_size += ::protobuf::rt::bytes_size(1, &v);
1417         }
1418         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
1419         self.special_fields.cached_size().set(my_size as u32);
1420         my_size
1421     }
1422 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>1423     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
1424         if let Some(v) = self.y.as_ref() {
1425             os.write_bytes(1, v)?;
1426         }
1427         os.write_unknown_fields(self.special_fields.unknown_fields())?;
1428         ::std::result::Result::Ok(())
1429     }
1430 
special_fields(&self) -> &::protobuf::SpecialFields1431     fn special_fields(&self) -> &::protobuf::SpecialFields {
1432         &self.special_fields
1433     }
1434 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields1435     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
1436         &mut self.special_fields
1437     }
1438 
new() -> DhPublicKey1439     fn new() -> DhPublicKey {
1440         DhPublicKey::new()
1441     }
1442 
clear(&mut self)1443     fn clear(&mut self) {
1444         self.y = ::std::option::Option::None;
1445         self.special_fields.clear();
1446     }
1447 
default_instance() -> &'static DhPublicKey1448     fn default_instance() -> &'static DhPublicKey {
1449         static instance: DhPublicKey = DhPublicKey {
1450             y: ::std::option::Option::None,
1451             special_fields: ::protobuf::SpecialFields::new(),
1452         };
1453         &instance
1454     }
1455 }
1456 
1457 #[derive(PartialEq,Clone,Default,Debug)]
1458 // @@protoc_insertion_point(message:securemessage.GenericPublicKey)
1459 pub struct GenericPublicKey {
1460     // message fields
1461     // @@protoc_insertion_point(field:securemessage.GenericPublicKey.type)
1462     pub type_: ::std::option::Option<::protobuf::EnumOrUnknown<PublicKeyType>>,
1463     // @@protoc_insertion_point(field:securemessage.GenericPublicKey.ec_p256_public_key)
1464     pub ec_p256_public_key: ::protobuf::MessageField<EcP256PublicKey>,
1465     // @@protoc_insertion_point(field:securemessage.GenericPublicKey.rsa2048_public_key)
1466     pub rsa2048_public_key: ::protobuf::MessageField<SimpleRsaPublicKey>,
1467     // @@protoc_insertion_point(field:securemessage.GenericPublicKey.dh2048_public_key)
1468     pub dh2048_public_key: ::protobuf::MessageField<DhPublicKey>,
1469     // special fields
1470     // @@protoc_insertion_point(special_field:securemessage.GenericPublicKey.special_fields)
1471     pub special_fields: ::protobuf::SpecialFields,
1472 }
1473 
1474 impl<'a> ::std::default::Default for &'a GenericPublicKey {
default() -> &'a GenericPublicKey1475     fn default() -> &'a GenericPublicKey {
1476         <GenericPublicKey as ::protobuf::Message>::default_instance()
1477     }
1478 }
1479 
1480 impl GenericPublicKey {
new() -> GenericPublicKey1481     pub fn new() -> GenericPublicKey {
1482         ::std::default::Default::default()
1483     }
1484 
1485     // required .securemessage.PublicKeyType type = 1;
1486 
type_(&self) -> PublicKeyType1487     pub fn type_(&self) -> PublicKeyType {
1488         match self.type_ {
1489             Some(e) => e.enum_value_or(PublicKeyType::EC_P256),
1490             None => PublicKeyType::EC_P256,
1491         }
1492     }
1493 
clear_type_(&mut self)1494     pub fn clear_type_(&mut self) {
1495         self.type_ = ::std::option::Option::None;
1496     }
1497 
has_type(&self) -> bool1498     pub fn has_type(&self) -> bool {
1499         self.type_.is_some()
1500     }
1501 
1502     // Param is passed by value, moved
set_type(&mut self, v: PublicKeyType)1503     pub fn set_type(&mut self, v: PublicKeyType) {
1504         self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
1505     }
1506 }
1507 
1508 impl ::protobuf::Message for GenericPublicKey {
1509     const NAME: &'static str = "GenericPublicKey";
1510 
is_initialized(&self) -> bool1511     fn is_initialized(&self) -> bool {
1512         if self.type_.is_none() {
1513             return false;
1514         }
1515         for v in &self.ec_p256_public_key {
1516             if !v.is_initialized() {
1517                 return false;
1518             }
1519         };
1520         for v in &self.rsa2048_public_key {
1521             if !v.is_initialized() {
1522                 return false;
1523             }
1524         };
1525         for v in &self.dh2048_public_key {
1526             if !v.is_initialized() {
1527                 return false;
1528             }
1529         };
1530         true
1531     }
1532 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>1533     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
1534         while let Some(tag) = is.read_raw_tag_or_eof()? {
1535             match tag {
1536                 8 => {
1537                     self.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?);
1538                 },
1539                 18 => {
1540                     ::protobuf::rt::read_singular_message_into_field(is, &mut self.ec_p256_public_key)?;
1541                 },
1542                 26 => {
1543                     ::protobuf::rt::read_singular_message_into_field(is, &mut self.rsa2048_public_key)?;
1544                 },
1545                 34 => {
1546                     ::protobuf::rt::read_singular_message_into_field(is, &mut self.dh2048_public_key)?;
1547                 },
1548                 tag => {
1549                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
1550                 },
1551             };
1552         }
1553         ::std::result::Result::Ok(())
1554     }
1555 
1556     // Compute sizes of nested messages
1557     #[allow(unused_variables)]
compute_size(&self) -> u641558     fn compute_size(&self) -> u64 {
1559         let mut my_size = 0;
1560         if let Some(v) = self.type_ {
1561             my_size += ::protobuf::rt::int32_size(1, v.value());
1562         }
1563         if let Some(v) = self.ec_p256_public_key.as_ref() {
1564             let len = v.compute_size();
1565             my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
1566         }
1567         if let Some(v) = self.rsa2048_public_key.as_ref() {
1568             let len = v.compute_size();
1569             my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
1570         }
1571         if let Some(v) = self.dh2048_public_key.as_ref() {
1572             let len = v.compute_size();
1573             my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
1574         }
1575         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
1576         self.special_fields.cached_size().set(my_size as u32);
1577         my_size
1578     }
1579 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>1580     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
1581         if let Some(v) = self.type_ {
1582             os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
1583         }
1584         if let Some(v) = self.ec_p256_public_key.as_ref() {
1585             ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
1586         }
1587         if let Some(v) = self.rsa2048_public_key.as_ref() {
1588             ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
1589         }
1590         if let Some(v) = self.dh2048_public_key.as_ref() {
1591             ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?;
1592         }
1593         os.write_unknown_fields(self.special_fields.unknown_fields())?;
1594         ::std::result::Result::Ok(())
1595     }
1596 
special_fields(&self) -> &::protobuf::SpecialFields1597     fn special_fields(&self) -> &::protobuf::SpecialFields {
1598         &self.special_fields
1599     }
1600 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields1601     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
1602         &mut self.special_fields
1603     }
1604 
new() -> GenericPublicKey1605     fn new() -> GenericPublicKey {
1606         GenericPublicKey::new()
1607     }
1608 
clear(&mut self)1609     fn clear(&mut self) {
1610         self.type_ = ::std::option::Option::None;
1611         self.ec_p256_public_key.clear();
1612         self.rsa2048_public_key.clear();
1613         self.dh2048_public_key.clear();
1614         self.special_fields.clear();
1615     }
1616 
default_instance() -> &'static GenericPublicKey1617     fn default_instance() -> &'static GenericPublicKey {
1618         static instance: GenericPublicKey = GenericPublicKey {
1619             type_: ::std::option::Option::None,
1620             ec_p256_public_key: ::protobuf::MessageField::none(),
1621             rsa2048_public_key: ::protobuf::MessageField::none(),
1622             dh2048_public_key: ::protobuf::MessageField::none(),
1623             special_fields: ::protobuf::SpecialFields::new(),
1624         };
1625         &instance
1626     }
1627 }
1628 
1629 #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
1630 // @@protoc_insertion_point(enum:securemessage.SigScheme)
1631 pub enum SigScheme {
1632     // @@protoc_insertion_point(enum_value:securemessage.SigScheme.HMAC_SHA256)
1633     HMAC_SHA256 = 1,
1634     // @@protoc_insertion_point(enum_value:securemessage.SigScheme.ECDSA_P256_SHA256)
1635     ECDSA_P256_SHA256 = 2,
1636     // @@protoc_insertion_point(enum_value:securemessage.SigScheme.RSA2048_SHA256)
1637     RSA2048_SHA256 = 3,
1638     // @@protoc_insertion_point(enum_value:securemessage.SigScheme.AEAD)
1639     AEAD = 4,
1640 }
1641 
1642 impl ::protobuf::Enum for SigScheme {
1643     const NAME: &'static str = "SigScheme";
1644 
value(&self) -> i321645     fn value(&self) -> i32 {
1646         *self as i32
1647     }
1648 
from_i32(value: i32) -> ::std::option::Option<SigScheme>1649     fn from_i32(value: i32) -> ::std::option::Option<SigScheme> {
1650         match value {
1651             1 => ::std::option::Option::Some(SigScheme::HMAC_SHA256),
1652             2 => ::std::option::Option::Some(SigScheme::ECDSA_P256_SHA256),
1653             3 => ::std::option::Option::Some(SigScheme::RSA2048_SHA256),
1654             4 => ::std::option::Option::Some(SigScheme::AEAD),
1655             _ => ::std::option::Option::None
1656         }
1657     }
1658 
1659     const VALUES: &'static [SigScheme] = &[
1660         SigScheme::HMAC_SHA256,
1661         SigScheme::ECDSA_P256_SHA256,
1662         SigScheme::RSA2048_SHA256,
1663         SigScheme::AEAD,
1664     ];
1665 }
1666 
1667 // Note, `Default` is implemented although default value is not 0
1668 impl ::std::default::Default for SigScheme {
default() -> Self1669     fn default() -> Self {
1670         SigScheme::HMAC_SHA256
1671     }
1672 }
1673 
1674 
1675 #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
1676 // @@protoc_insertion_point(enum:securemessage.EncScheme)
1677 pub enum EncScheme {
1678     // @@protoc_insertion_point(enum_value:securemessage.EncScheme.NONE)
1679     NONE = 1,
1680     // @@protoc_insertion_point(enum_value:securemessage.EncScheme.AES_256_CBC)
1681     AES_256_CBC = 2,
1682     // @@protoc_insertion_point(enum_value:securemessage.EncScheme.AES_256_GCM_SIV)
1683     AES_256_GCM_SIV = 3,
1684 }
1685 
1686 impl ::protobuf::Enum for EncScheme {
1687     const NAME: &'static str = "EncScheme";
1688 
value(&self) -> i321689     fn value(&self) -> i32 {
1690         *self as i32
1691     }
1692 
from_i32(value: i32) -> ::std::option::Option<EncScheme>1693     fn from_i32(value: i32) -> ::std::option::Option<EncScheme> {
1694         match value {
1695             1 => ::std::option::Option::Some(EncScheme::NONE),
1696             2 => ::std::option::Option::Some(EncScheme::AES_256_CBC),
1697             3 => ::std::option::Option::Some(EncScheme::AES_256_GCM_SIV),
1698             _ => ::std::option::Option::None
1699         }
1700     }
1701 
1702     const VALUES: &'static [EncScheme] = &[
1703         EncScheme::NONE,
1704         EncScheme::AES_256_CBC,
1705         EncScheme::AES_256_GCM_SIV,
1706     ];
1707 }
1708 
1709 // Note, `Default` is implemented although default value is not 0
1710 impl ::std::default::Default for EncScheme {
default() -> Self1711     fn default() -> Self {
1712         EncScheme::NONE
1713     }
1714 }
1715 
1716 
1717 #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
1718 // @@protoc_insertion_point(enum:securemessage.PublicKeyType)
1719 pub enum PublicKeyType {
1720     // @@protoc_insertion_point(enum_value:securemessage.PublicKeyType.EC_P256)
1721     EC_P256 = 1,
1722     // @@protoc_insertion_point(enum_value:securemessage.PublicKeyType.RSA2048)
1723     RSA2048 = 2,
1724     // @@protoc_insertion_point(enum_value:securemessage.PublicKeyType.DH2048_MODP)
1725     DH2048_MODP = 3,
1726 }
1727 
1728 impl ::protobuf::Enum for PublicKeyType {
1729     const NAME: &'static str = "PublicKeyType";
1730 
value(&self) -> i321731     fn value(&self) -> i32 {
1732         *self as i32
1733     }
1734 
from_i32(value: i32) -> ::std::option::Option<PublicKeyType>1735     fn from_i32(value: i32) -> ::std::option::Option<PublicKeyType> {
1736         match value {
1737             1 => ::std::option::Option::Some(PublicKeyType::EC_P256),
1738             2 => ::std::option::Option::Some(PublicKeyType::RSA2048),
1739             3 => ::std::option::Option::Some(PublicKeyType::DH2048_MODP),
1740             _ => ::std::option::Option::None
1741         }
1742     }
1743 
1744     const VALUES: &'static [PublicKeyType] = &[
1745         PublicKeyType::EC_P256,
1746         PublicKeyType::RSA2048,
1747         PublicKeyType::DH2048_MODP,
1748     ];
1749 }
1750 
1751 // Note, `Default` is implemented although default value is not 0
1752 impl ::std::default::Default for PublicKeyType {
default() -> Self1753     fn default() -> Self {
1754         PublicKeyType::EC_P256
1755     }
1756 }
1757 
1758