web_sys/features/
gen_JsonWebKey.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = JsonWebKey)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `JsonWebKey` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
12    pub type JsonWebKey;
13    #[doc = "Get the `alg` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
16    #[wasm_bindgen(method, getter = "alg")]
17    pub fn get_alg(this: &JsonWebKey) -> Option<::alloc::string::String>;
18    #[doc = "Change the `alg` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
21    #[wasm_bindgen(method, setter = "alg")]
22    pub fn set_alg(this: &JsonWebKey, val: &str);
23    #[doc = "Get the `crv` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
26    #[wasm_bindgen(method, getter = "crv")]
27    pub fn get_crv(this: &JsonWebKey) -> Option<::alloc::string::String>;
28    #[doc = "Change the `crv` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
31    #[wasm_bindgen(method, setter = "crv")]
32    pub fn set_crv(this: &JsonWebKey, val: &str);
33    #[doc = "Get the `d` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
36    #[wasm_bindgen(method, getter = "d")]
37    pub fn get_d(this: &JsonWebKey) -> Option<::alloc::string::String>;
38    #[doc = "Change the `d` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
41    #[wasm_bindgen(method, setter = "d")]
42    pub fn set_d(this: &JsonWebKey, val: &str);
43    #[doc = "Get the `dp` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
46    #[wasm_bindgen(method, getter = "dp")]
47    pub fn get_dp(this: &JsonWebKey) -> Option<::alloc::string::String>;
48    #[doc = "Change the `dp` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
51    #[wasm_bindgen(method, setter = "dp")]
52    pub fn set_dp(this: &JsonWebKey, val: &str);
53    #[doc = "Get the `dq` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
56    #[wasm_bindgen(method, getter = "dq")]
57    pub fn get_dq(this: &JsonWebKey) -> Option<::alloc::string::String>;
58    #[doc = "Change the `dq` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
61    #[wasm_bindgen(method, setter = "dq")]
62    pub fn set_dq(this: &JsonWebKey, val: &str);
63    #[doc = "Get the `e` field of this object."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
66    #[wasm_bindgen(method, getter = "e")]
67    pub fn get_e(this: &JsonWebKey) -> Option<::alloc::string::String>;
68    #[doc = "Change the `e` field of this object."]
69    #[doc = ""]
70    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
71    #[wasm_bindgen(method, setter = "e")]
72    pub fn set_e(this: &JsonWebKey, val: &str);
73    #[doc = "Get the `ext` field of this object."]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
76    #[wasm_bindgen(method, getter = "ext")]
77    pub fn get_ext(this: &JsonWebKey) -> Option<bool>;
78    #[doc = "Change the `ext` field of this object."]
79    #[doc = ""]
80    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
81    #[wasm_bindgen(method, setter = "ext")]
82    pub fn set_ext(this: &JsonWebKey, val: bool);
83    #[doc = "Get the `k` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
86    #[wasm_bindgen(method, getter = "k")]
87    pub fn get_k(this: &JsonWebKey) -> Option<::alloc::string::String>;
88    #[doc = "Change the `k` field of this object."]
89    #[doc = ""]
90    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
91    #[wasm_bindgen(method, setter = "k")]
92    pub fn set_k(this: &JsonWebKey, val: &str);
93    #[doc = "Get the `key_ops` field of this object."]
94    #[doc = ""]
95    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
96    #[wasm_bindgen(method, getter = "key_ops")]
97    pub fn get_key_ops(this: &JsonWebKey) -> Option<::js_sys::Array>;
98    #[doc = "Change the `key_ops` field of this object."]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
101    #[wasm_bindgen(method, setter = "key_ops")]
102    pub fn set_key_ops(this: &JsonWebKey, val: &::wasm_bindgen::JsValue);
103    #[doc = "Get the `kty` field of this object."]
104    #[doc = ""]
105    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
106    #[wasm_bindgen(method, getter = "kty")]
107    pub fn get_kty(this: &JsonWebKey) -> ::alloc::string::String;
108    #[doc = "Change the `kty` field of this object."]
109    #[doc = ""]
110    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
111    #[wasm_bindgen(method, setter = "kty")]
112    pub fn set_kty(this: &JsonWebKey, val: &str);
113    #[doc = "Get the `n` field of this object."]
114    #[doc = ""]
115    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
116    #[wasm_bindgen(method, getter = "n")]
117    pub fn get_n(this: &JsonWebKey) -> Option<::alloc::string::String>;
118    #[doc = "Change the `n` field of this object."]
119    #[doc = ""]
120    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
121    #[wasm_bindgen(method, setter = "n")]
122    pub fn set_n(this: &JsonWebKey, val: &str);
123    #[doc = "Get the `oth` field of this object."]
124    #[doc = ""]
125    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
126    #[wasm_bindgen(method, getter = "oth")]
127    pub fn get_oth(this: &JsonWebKey) -> Option<::js_sys::Array>;
128    #[doc = "Change the `oth` field of this object."]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
131    #[wasm_bindgen(method, setter = "oth")]
132    pub fn set_oth(this: &JsonWebKey, val: &::wasm_bindgen::JsValue);
133    #[doc = "Get the `p` field of this object."]
134    #[doc = ""]
135    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
136    #[wasm_bindgen(method, getter = "p")]
137    pub fn get_p(this: &JsonWebKey) -> Option<::alloc::string::String>;
138    #[doc = "Change the `p` field of this object."]
139    #[doc = ""]
140    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
141    #[wasm_bindgen(method, setter = "p")]
142    pub fn set_p(this: &JsonWebKey, val: &str);
143    #[doc = "Get the `q` field of this object."]
144    #[doc = ""]
145    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
146    #[wasm_bindgen(method, getter = "q")]
147    pub fn get_q(this: &JsonWebKey) -> Option<::alloc::string::String>;
148    #[doc = "Change the `q` field of this object."]
149    #[doc = ""]
150    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
151    #[wasm_bindgen(method, setter = "q")]
152    pub fn set_q(this: &JsonWebKey, val: &str);
153    #[doc = "Get the `qi` field of this object."]
154    #[doc = ""]
155    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
156    #[wasm_bindgen(method, getter = "qi")]
157    pub fn get_qi(this: &JsonWebKey) -> Option<::alloc::string::String>;
158    #[doc = "Change the `qi` field of this object."]
159    #[doc = ""]
160    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
161    #[wasm_bindgen(method, setter = "qi")]
162    pub fn set_qi(this: &JsonWebKey, val: &str);
163    #[doc = "Get the `use` field of this object."]
164    #[doc = ""]
165    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
166    #[wasm_bindgen(method, getter = "use")]
167    pub fn get_use(this: &JsonWebKey) -> Option<::alloc::string::String>;
168    #[doc = "Change the `use` field of this object."]
169    #[doc = ""]
170    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
171    #[wasm_bindgen(method, setter = "use")]
172    pub fn set_use(this: &JsonWebKey, val: &str);
173    #[doc = "Get the `x` field of this object."]
174    #[doc = ""]
175    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
176    #[wasm_bindgen(method, getter = "x")]
177    pub fn get_x(this: &JsonWebKey) -> Option<::alloc::string::String>;
178    #[doc = "Change the `x` field of this object."]
179    #[doc = ""]
180    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
181    #[wasm_bindgen(method, setter = "x")]
182    pub fn set_x(this: &JsonWebKey, val: &str);
183    #[doc = "Get the `y` field of this object."]
184    #[doc = ""]
185    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
186    #[wasm_bindgen(method, getter = "y")]
187    pub fn get_y(this: &JsonWebKey) -> Option<::alloc::string::String>;
188    #[doc = "Change the `y` field of this object."]
189    #[doc = ""]
190    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
191    #[wasm_bindgen(method, setter = "y")]
192    pub fn set_y(this: &JsonWebKey, val: &str);
193}
194impl JsonWebKey {
195    #[doc = "Construct a new `JsonWebKey`."]
196    #[doc = ""]
197    #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
198    pub fn new(kty: &str) -> Self {
199        #[allow(unused_mut)]
200        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
201        ret.set_kty(kty);
202        ret
203    }
204    #[deprecated = "Use `set_alg()` instead."]
205    pub fn alg(&mut self, val: &str) -> &mut Self {
206        self.set_alg(val);
207        self
208    }
209    #[deprecated = "Use `set_crv()` instead."]
210    pub fn crv(&mut self, val: &str) -> &mut Self {
211        self.set_crv(val);
212        self
213    }
214    #[deprecated = "Use `set_d()` instead."]
215    pub fn d(&mut self, val: &str) -> &mut Self {
216        self.set_d(val);
217        self
218    }
219    #[deprecated = "Use `set_dp()` instead."]
220    pub fn dp(&mut self, val: &str) -> &mut Self {
221        self.set_dp(val);
222        self
223    }
224    #[deprecated = "Use `set_dq()` instead."]
225    pub fn dq(&mut self, val: &str) -> &mut Self {
226        self.set_dq(val);
227        self
228    }
229    #[deprecated = "Use `set_e()` instead."]
230    pub fn e(&mut self, val: &str) -> &mut Self {
231        self.set_e(val);
232        self
233    }
234    #[deprecated = "Use `set_ext()` instead."]
235    pub fn ext(&mut self, val: bool) -> &mut Self {
236        self.set_ext(val);
237        self
238    }
239    #[deprecated = "Use `set_k()` instead."]
240    pub fn k(&mut self, val: &str) -> &mut Self {
241        self.set_k(val);
242        self
243    }
244    #[deprecated = "Use `set_key_ops()` instead."]
245    pub fn key_ops(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
246        self.set_key_ops(val);
247        self
248    }
249    #[deprecated = "Use `set_kty()` instead."]
250    pub fn kty(&mut self, val: &str) -> &mut Self {
251        self.set_kty(val);
252        self
253    }
254    #[deprecated = "Use `set_n()` instead."]
255    pub fn n(&mut self, val: &str) -> &mut Self {
256        self.set_n(val);
257        self
258    }
259    #[deprecated = "Use `set_oth()` instead."]
260    pub fn oth(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
261        self.set_oth(val);
262        self
263    }
264    #[deprecated = "Use `set_p()` instead."]
265    pub fn p(&mut self, val: &str) -> &mut Self {
266        self.set_p(val);
267        self
268    }
269    #[deprecated = "Use `set_q()` instead."]
270    pub fn q(&mut self, val: &str) -> &mut Self {
271        self.set_q(val);
272        self
273    }
274    #[deprecated = "Use `set_qi()` instead."]
275    pub fn qi(&mut self, val: &str) -> &mut Self {
276        self.set_qi(val);
277        self
278    }
279    #[deprecated = "Use `set_use()` instead."]
280    pub fn use_(&mut self, val: &str) -> &mut Self {
281        self.set_use(val);
282        self
283    }
284    #[deprecated = "Use `set_x()` instead."]
285    pub fn x(&mut self, val: &str) -> &mut Self {
286        self.set_x(val);
287        self
288    }
289    #[deprecated = "Use `set_y()` instead."]
290    pub fn y(&mut self, val: &str) -> &mut Self {
291        self.set_y(val);
292        self
293    }
294}