1 module libwasm.bindings.SubtleCrypto;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 @safe:
7 nothrow:
8 
9 struct AesCbcParams {
10   nothrow:
11   libwasm.bindings.SubtleCrypto.Algorithm _parent;
12   alias _parent this;
13   this(Handle h) {
14     _parent = .Algorithm(h);
15   }
16   static auto create() {
17     return AesCbcParams(libwasm_add__object());
18   }
19   void iv()(scope ref BufferSource iv) {
20     Object_Call_Handle__void(this._parent, "iv", iv.handle);
21   }
22   auto iv()() {
23     return BufferSource(Object_Getter__Handle(this._parent, "iv"));
24   }
25 }
26 struct AesCtrParams {
27   nothrow:
28   libwasm.bindings.SubtleCrypto.Algorithm _parent;
29   alias _parent this;
30   this(Handle h) {
31     _parent = .Algorithm(h);
32   }
33   static auto create() {
34     return AesCtrParams(libwasm_add__object());
35   }
36   void counter()(scope ref BufferSource counter) {
37     Object_Call_Handle__void(this._parent, "counter", counter.handle);
38   }
39   auto counter()() {
40     return BufferSource(Object_Getter__Handle(this._parent, "counter"));
41   }
42   void length()(ubyte length) {
43     Serialize_Object_VarArgCall!void(this._parent, "length", "ubyte", tuple(length));
44   }
45   ubyte length()() {
46     return AesCtrParams_length_Get(this._parent);
47   }
48 }
49 struct AesDerivedKeyParams {
50   nothrow:
51   libwasm.bindings.SubtleCrypto.Algorithm _parent;
52   alias _parent this;
53   this(Handle h) {
54     _parent = .Algorithm(h);
55   }
56   static auto create() {
57     return AesDerivedKeyParams(libwasm_add__object());
58   }
59   void length()(uint length) {
60     Object_Call_uint__void(this._parent, "length", length);
61   }
62   uint length()() {
63     return Object_Getter__uint(this._parent, "length");
64   }
65 }
66 struct AesGcmParams {
67   nothrow:
68   libwasm.bindings.SubtleCrypto.Algorithm _parent;
69   alias _parent this;
70   this(Handle h) {
71     _parent = .Algorithm(h);
72   }
73   static auto create() {
74     return AesGcmParams(libwasm_add__object());
75   }
76   void iv()(scope ref BufferSource iv) {
77     Object_Call_Handle__void(this._parent, "iv", iv.handle);
78   }
79   auto iv()() {
80     return BufferSource(Object_Getter__Handle(this._parent, "iv"));
81   }
82   void additionalData()(scope ref BufferSource additionalData) {
83     Object_Call_Handle__void(this._parent, "additionalData", additionalData.handle);
84   }
85   auto additionalData()() {
86     return BufferSource(Object_Getter__Handle(this._parent, "additionalData"));
87   }
88   void tagLength()(ubyte tagLength) {
89     Serialize_Object_VarArgCall!void(this._parent, "tagLength", "ubyte", tuple(tagLength));
90   }
91   ubyte tagLength()() {
92     return AesGcmParams_tagLength_Get(this._parent);
93   }
94 }
95 struct AesKeyGenParams {
96   nothrow:
97   libwasm.bindings.SubtleCrypto.Algorithm _parent;
98   alias _parent this;
99   this(Handle h) {
100     _parent = .Algorithm(h);
101   }
102   static auto create() {
103     return AesKeyGenParams(libwasm_add__object());
104   }
105   void length()(ushort length) {
106     Serialize_Object_VarArgCall!void(this._parent, "length", "ushort", tuple(length));
107   }
108   ushort length()() {
109     return Object_Getter__ushort(this._parent, "length");
110   }
111 }
112 struct Algorithm {
113   nothrow:
114   JsHandle handle;
115   alias handle this;
116   this(Handle h) {
117     this.handle = JsHandle(h);
118   }
119   static auto create() {
120     return Algorithm(libwasm_add__object());
121   }
122   void name()(string name) {
123     Object_Call_string__void(this.handle, "name", name);
124   }
125   string name()() {
126     return Object_Getter__string(this.handle, "name");
127   }
128 }
129 alias AlgorithmIdentifier = SumType!(JsObject, string);
130 alias BigInteger = Uint8Array;
131 struct CryptoKey {
132   nothrow:
133   JsHandle handle;
134   alias handle this;
135   this(Handle h) {
136     this.handle = JsHandle(h);
137   }
138   string type()() {
139     return Object_Getter__string(this.handle, "type");
140   }
141   bool extractable()() {
142     return Object_Getter__bool(this.handle, "extractable");
143   }
144   auto algorithm()() {
145     return JsObject(Object_Getter__Handle(this.handle, "algorithm"));
146   }
147   auto usages()() {
148     return Sequence!(string)(Object_Getter__Handle(this.handle, "usages"));
149   }
150 }
151 struct CryptoKeyPair {
152   nothrow:
153   JsHandle handle;
154   alias handle this;
155   this(Handle h) {
156     this.handle = JsHandle(h);
157   }
158   static auto create() {
159     return CryptoKeyPair(libwasm_add__object());
160   }
161   void publicKey()(scope ref CryptoKey publicKey) {
162     Object_Call_Handle__void(this.handle, "publicKey", publicKey.handle);
163   }
164   auto publicKey()() {
165     return CryptoKey(Object_Getter__Handle(this.handle, "publicKey"));
166   }
167   void privateKey()(scope ref CryptoKey privateKey) {
168     Object_Call_Handle__void(this.handle, "privateKey", privateKey.handle);
169   }
170   auto privateKey()() {
171     return CryptoKey(Object_Getter__Handle(this.handle, "privateKey"));
172   }
173 }
174 struct DhImportKeyParams {
175   nothrow:
176   libwasm.bindings.SubtleCrypto.Algorithm _parent;
177   alias _parent this;
178   this(Handle h) {
179     _parent = .Algorithm(h);
180   }
181   static auto create() {
182     return DhImportKeyParams(libwasm_add__object());
183   }
184   void prime()(scope ref BigInteger prime) {
185     Object_Call_Handle__void(this._parent, "prime", prime.handle);
186   }
187   auto prime()() {
188     return BigInteger(Object_Getter__Handle(this._parent, "prime"));
189   }
190   void generator()(scope ref BigInteger generator) {
191     Object_Call_Handle__void(this._parent, "generator", generator.handle);
192   }
193   auto generator()() {
194     return BigInteger(Object_Getter__Handle(this._parent, "generator"));
195   }
196 }
197 struct DhKeyDeriveParams {
198   nothrow:
199   libwasm.bindings.SubtleCrypto.Algorithm _parent;
200   alias _parent this;
201   this(Handle h) {
202     _parent = .Algorithm(h);
203   }
204   static auto create() {
205     return DhKeyDeriveParams(libwasm_add__object());
206   }
207   void public_()(scope ref CryptoKey public_) {
208     Object_Call_Handle__void(this._parent, "public", public_.handle);
209   }
210   auto public_()() {
211     return CryptoKey(Object_Getter__Handle(this._parent, "public"));
212   }
213 }
214 struct DhKeyGenParams {
215   nothrow:
216   libwasm.bindings.SubtleCrypto.Algorithm _parent;
217   alias _parent this;
218   this(Handle h) {
219     _parent = .Algorithm(h);
220   }
221   static auto create() {
222     return DhKeyGenParams(libwasm_add__object());
223   }
224   void prime()(scope ref BigInteger prime) {
225     Object_Call_Handle__void(this._parent, "prime", prime.handle);
226   }
227   auto prime()() {
228     return BigInteger(Object_Getter__Handle(this._parent, "prime"));
229   }
230   void generator()(scope ref BigInteger generator) {
231     Object_Call_Handle__void(this._parent, "generator", generator.handle);
232   }
233   auto generator()() {
234     return BigInteger(Object_Getter__Handle(this._parent, "generator"));
235   }
236 }
237 struct EcKeyGenParams {
238   nothrow:
239   libwasm.bindings.SubtleCrypto.Algorithm _parent;
240   alias _parent this;
241   this(Handle h) {
242     _parent = .Algorithm(h);
243   }
244   static auto create() {
245     return EcKeyGenParams(libwasm_add__object());
246   }
247   void namedCurve()(string namedCurve) {
248     Object_Call_string__void(this._parent, "namedCurve", namedCurve);
249   }
250   string namedCurve()() {
251     return Object_Getter__string(this._parent, "namedCurve");
252   }
253 }
254 struct EcKeyImportParams {
255   nothrow:
256   libwasm.bindings.SubtleCrypto.Algorithm _parent;
257   alias _parent this;
258   this(Handle h) {
259     _parent = .Algorithm(h);
260   }
261   static auto create() {
262     return EcKeyImportParams(libwasm_add__object());
263   }
264   void namedCurve()(string namedCurve) {
265     Object_Call_string__void(this._parent, "namedCurve", namedCurve);
266   }
267   string namedCurve()() {
268     return Object_Getter__string(this._parent, "namedCurve");
269   }
270 }
271 struct EcdhKeyDeriveParams {
272   nothrow:
273   libwasm.bindings.SubtleCrypto.Algorithm _parent;
274   alias _parent this;
275   this(Handle h) {
276     _parent = .Algorithm(h);
277   }
278   static auto create() {
279     return EcdhKeyDeriveParams(libwasm_add__object());
280   }
281   void public_()(scope ref CryptoKey public_) {
282     Object_Call_Handle__void(this._parent, "public", public_.handle);
283   }
284   auto public_()() {
285     return CryptoKey(Object_Getter__Handle(this._parent, "public"));
286   }
287 }
288 struct EcdsaParams {
289   nothrow:
290   libwasm.bindings.SubtleCrypto.Algorithm _parent;
291   alias _parent this;
292   this(Handle h) {
293     _parent = .Algorithm(h);
294   }
295   static auto create() {
296     return EcdsaParams(libwasm_add__object());
297   }
298   void hash()(scope ref AlgorithmIdentifier hash) {
299     Serialize_Object_VarArgCall!void(this._parent, "hash", "SumType!(Handle,string)", tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => 0),((string v) => 1))(hash),tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(hash),libwasm.sumtype.match!(((ref hash.Types[0] v) => string.init),((string v) => v))(hash))));
300   }
301   auto hash()() {
302     return Object_Getter__Handle(this._parent, "hash");
303   }
304 }
305 struct HkdfParams {
306   nothrow:
307   libwasm.bindings.SubtleCrypto.Algorithm _parent;
308   alias _parent this;
309   this(Handle h) {
310     _parent = .Algorithm(h);
311   }
312   static auto create() {
313     return HkdfParams(libwasm_add__object());
314   }
315   void hash()(scope ref AlgorithmIdentifier hash) {
316     Serialize_Object_VarArgCall!void(this._parent, "hash", "SumType!(Handle,string)", tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => 0),((string v) => 1))(hash),tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(hash),libwasm.sumtype.match!(((ref hash.Types[0] v) => string.init),((string v) => v))(hash))));
317   }
318   auto hash()() {
319     return Object_Getter__Handle(this._parent, "hash");
320   }
321   void salt()(scope ref BufferSource salt) {
322     Object_Call_Handle__void(this._parent, "salt", salt.handle);
323   }
324   auto salt()() {
325     return BufferSource(Object_Getter__Handle(this._parent, "salt"));
326   }
327   void info()(scope ref BufferSource info) {
328     Object_Call_Handle__void(this._parent, "info", info.handle);
329   }
330   auto info()() {
331     return BufferSource(Object_Getter__Handle(this._parent, "info"));
332   }
333 }
334 struct HmacDerivedKeyParams {
335   nothrow:
336   libwasm.bindings.SubtleCrypto.HmacImportParams _parent;
337   alias _parent this;
338   this(Handle h) {
339     _parent = .HmacImportParams(h);
340   }
341   static auto create() {
342     return HmacDerivedKeyParams(libwasm_add__object());
343   }
344   void length()(uint length) {
345     Object_Call_uint__void(this._parent, "length", length);
346   }
347   uint length()() {
348     return Object_Getter__uint(this._parent, "length");
349   }
350 }
351 struct HmacImportParams {
352   nothrow:
353   libwasm.bindings.SubtleCrypto.Algorithm _parent;
354   alias _parent this;
355   this(Handle h) {
356     _parent = .Algorithm(h);
357   }
358   static auto create() {
359     return HmacImportParams(libwasm_add__object());
360   }
361   void hash()(scope ref AlgorithmIdentifier hash) {
362     Serialize_Object_VarArgCall!void(this._parent, "hash", "SumType!(Handle,string)", tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => 0),((string v) => 1))(hash),tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(hash),libwasm.sumtype.match!(((ref hash.Types[0] v) => string.init),((string v) => v))(hash))));
363   }
364   auto hash()() {
365     return Object_Getter__Handle(this._parent, "hash");
366   }
367 }
368 struct HmacKeyGenParams {
369   nothrow:
370   libwasm.bindings.SubtleCrypto.Algorithm _parent;
371   alias _parent this;
372   this(Handle h) {
373     _parent = .Algorithm(h);
374   }
375   static auto create() {
376     return HmacKeyGenParams(libwasm_add__object());
377   }
378   void hash()(scope ref AlgorithmIdentifier hash) {
379     Serialize_Object_VarArgCall!void(this._parent, "hash", "SumType!(Handle,string)", tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => 0),((string v) => 1))(hash),tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(hash),libwasm.sumtype.match!(((ref hash.Types[0] v) => string.init),((string v) => v))(hash))));
380   }
381   auto hash()() {
382     return Object_Getter__Handle(this._parent, "hash");
383   }
384   void length()(uint length) {
385     Object_Call_uint__void(this._parent, "length", length);
386   }
387   uint length()() {
388     return Object_Getter__uint(this._parent, "length");
389   }
390 }
391 struct JsonWebKey {
392   nothrow:
393   JsHandle handle;
394   alias handle this;
395   this(Handle h) {
396     this.handle = JsHandle(h);
397   }
398   static auto create() {
399     return JsonWebKey(libwasm_add__object());
400   }
401   void kty()(string kty) {
402     Object_Call_string__void(this.handle, "kty", kty);
403   }
404   string kty()() {
405     return Object_Getter__string(this.handle, "kty");
406   }
407   void use()(string use) {
408     Object_Call_string__void(this.handle, "use", use);
409   }
410   string use()() {
411     return Object_Getter__string(this.handle, "use");
412   }
413   void key_ops()(scope ref Sequence!(string) key_ops) {
414     Object_Call_Handle__void(this.handle, "key_ops", key_ops.handle);
415   }
416   auto key_ops()() {
417     return Sequence!(string)(Object_Getter__Handle(this.handle, "key_ops"));
418   }
419   void alg()(string alg) {
420     Object_Call_string__void(this.handle, "alg", alg);
421   }
422   string alg()() {
423     return Object_Getter__string(this.handle, "alg");
424   }
425   void ext()(bool ext) {
426     Object_Call_bool__void(this.handle, "ext", ext);
427   }
428   bool ext()() {
429     return Object_Getter__bool(this.handle, "ext");
430   }
431   void crv()(string crv) {
432     Object_Call_string__void(this.handle, "crv", crv);
433   }
434   string crv()() {
435     return Object_Getter__string(this.handle, "crv");
436   }
437   void x()(string x) {
438     Object_Call_string__void(this.handle, "x", x);
439   }
440   string x()() {
441     return Object_Getter__string(this.handle, "x");
442   }
443   void y()(string y) {
444     Object_Call_string__void(this.handle, "y", y);
445   }
446   string y()() {
447     return Object_Getter__string(this.handle, "y");
448   }
449   void d()(string d) {
450     Object_Call_string__void(this.handle, "d", d);
451   }
452   string d()() {
453     return Object_Getter__string(this.handle, "d");
454   }
455   void n()(string n) {
456     Object_Call_string__void(this.handle, "n", n);
457   }
458   string n()() {
459     return Object_Getter__string(this.handle, "n");
460   }
461   void e()(string e) {
462     Object_Call_string__void(this.handle, "e", e);
463   }
464   string e()() {
465     return Object_Getter__string(this.handle, "e");
466   }
467   void p()(string p) {
468     Object_Call_string__void(this.handle, "p", p);
469   }
470   string p()() {
471     return Object_Getter__string(this.handle, "p");
472   }
473   void q()(string q) {
474     Object_Call_string__void(this.handle, "q", q);
475   }
476   string q()() {
477     return Object_Getter__string(this.handle, "q");
478   }
479   void dp()(string dp) {
480     Object_Call_string__void(this.handle, "dp", dp);
481   }
482   string dp()() {
483     return Object_Getter__string(this.handle, "dp");
484   }
485   void dq()(string dq) {
486     Object_Call_string__void(this.handle, "dq", dq);
487   }
488   string dq()() {
489     return Object_Getter__string(this.handle, "dq");
490   }
491   void qi()(string qi) {
492     Object_Call_string__void(this.handle, "qi", qi);
493   }
494   string qi()() {
495     return Object_Getter__string(this.handle, "qi");
496   }
497   void oth()(scope ref Sequence!(RsaOtherPrimesInfo) oth) {
498     Object_Call_Handle__void(this.handle, "oth", oth.handle);
499   }
500   auto oth()() {
501     return Sequence!(RsaOtherPrimesInfo)(Object_Getter__Handle(this.handle, "oth"));
502   }
503   void k()(string k) {
504     Object_Call_string__void(this.handle, "k", k);
505   }
506   string k()() {
507     return Object_Getter__string(this.handle, "k");
508   }
509 }
510 alias KeyFormat = string;
511 alias KeyType = string;
512 alias KeyUsage = string;
513 alias NamedCurve = string;
514 struct Pbkdf2Params {
515   nothrow:
516   libwasm.bindings.SubtleCrypto.Algorithm _parent;
517   alias _parent this;
518   this(Handle h) {
519     _parent = .Algorithm(h);
520   }
521   static auto create() {
522     return Pbkdf2Params(libwasm_add__object());
523   }
524   void salt()(scope ref BufferSource salt) {
525     Object_Call_Handle__void(this._parent, "salt", salt.handle);
526   }
527   auto salt()() {
528     return BufferSource(Object_Getter__Handle(this._parent, "salt"));
529   }
530   void iterations()(uint iterations) {
531     Object_Call_uint__void(this._parent, "iterations", iterations);
532   }
533   uint iterations()() {
534     return Object_Getter__uint(this._parent, "iterations");
535   }
536   void hash()(scope ref AlgorithmIdentifier hash) {
537     Serialize_Object_VarArgCall!void(this._parent, "hash", "SumType!(Handle,string)", tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => 0),((string v) => 1))(hash),tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(hash),libwasm.sumtype.match!(((ref hash.Types[0] v) => string.init),((string v) => v))(hash))));
538   }
539   auto hash()() {
540     return Object_Getter__Handle(this._parent, "hash");
541   }
542 }
543 struct RsaHashedImportParams {
544   nothrow:
545   JsHandle handle;
546   alias handle this;
547   this(Handle h) {
548     this.handle = JsHandle(h);
549   }
550   static auto create() {
551     return RsaHashedImportParams(libwasm_add__object());
552   }
553   void hash()(scope ref AlgorithmIdentifier hash) {
554     Serialize_Object_VarArgCall!void(this.handle, "hash", "SumType!(Handle,string)", tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => 0),((string v) => 1))(hash),tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(hash),libwasm.sumtype.match!(((ref hash.Types[0] v) => string.init),((string v) => v))(hash))));
555   }
556   auto hash()() {
557     return Object_Getter__Handle(this.handle, "hash");
558   }
559 }
560 struct RsaHashedKeyGenParams {
561   nothrow:
562   libwasm.bindings.SubtleCrypto.Algorithm _parent;
563   alias _parent this;
564   this(Handle h) {
565     _parent = .Algorithm(h);
566   }
567   static auto create() {
568     return RsaHashedKeyGenParams(libwasm_add__object());
569   }
570   void modulusLength()(uint modulusLength) {
571     Object_Call_uint__void(this._parent, "modulusLength", modulusLength);
572   }
573   uint modulusLength()() {
574     return Object_Getter__uint(this._parent, "modulusLength");
575   }
576   void publicExponent()(scope ref BigInteger publicExponent) {
577     Object_Call_Handle__void(this._parent, "publicExponent", publicExponent.handle);
578   }
579   auto publicExponent()() {
580     return BigInteger(Object_Getter__Handle(this._parent, "publicExponent"));
581   }
582   void hash()(scope ref AlgorithmIdentifier hash) {
583     Serialize_Object_VarArgCall!void(this._parent, "hash", "SumType!(Handle,string)", tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => 0),((string v) => 1))(hash),tuple(libwasm.sumtype.match!(((ref hash.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(hash),libwasm.sumtype.match!(((ref hash.Types[0] v) => string.init),((string v) => v))(hash))));
584   }
585   auto hash()() {
586     return Object_Getter__Handle(this._parent, "hash");
587   }
588 }
589 struct RsaOaepParams {
590   nothrow:
591   libwasm.bindings.SubtleCrypto.Algorithm _parent;
592   alias _parent this;
593   this(Handle h) {
594     _parent = .Algorithm(h);
595   }
596   static auto create() {
597     return RsaOaepParams(libwasm_add__object());
598   }
599   void label()(scope ref BufferSource label) {
600     Object_Call_Handle__void(this._parent, "label", label.handle);
601   }
602   auto label()() {
603     return BufferSource(Object_Getter__Handle(this._parent, "label"));
604   }
605 }
606 struct RsaOtherPrimesInfo {
607   nothrow:
608   JsHandle handle;
609   alias handle this;
610   this(Handle h) {
611     this.handle = JsHandle(h);
612   }
613   static auto create() {
614     return RsaOtherPrimesInfo(libwasm_add__object());
615   }
616   void r()(string r) {
617     Object_Call_string__void(this.handle, "r", r);
618   }
619   string r()() {
620     return Object_Getter__string(this.handle, "r");
621   }
622   void d()(string d) {
623     Object_Call_string__void(this.handle, "d", d);
624   }
625   string d()() {
626     return Object_Getter__string(this.handle, "d");
627   }
628   void t()(string t) {
629     Object_Call_string__void(this.handle, "t", t);
630   }
631   string t()() {
632     return Object_Getter__string(this.handle, "t");
633   }
634 }
635 struct RsaPssParams {
636   nothrow:
637   libwasm.bindings.SubtleCrypto.Algorithm _parent;
638   alias _parent this;
639   this(Handle h) {
640     _parent = .Algorithm(h);
641   }
642   static auto create() {
643     return RsaPssParams(libwasm_add__object());
644   }
645   void saltLength()(uint saltLength) {
646     Object_Call_uint__void(this._parent, "saltLength", saltLength);
647   }
648   uint saltLength()() {
649     return Object_Getter__uint(this._parent, "saltLength");
650   }
651 }
652 struct SubtleCrypto {
653   nothrow:
654   JsHandle handle;
655   alias handle this;
656   this(Handle h) {
657     this.handle = JsHandle(h);
658   }
659   auto encrypt()(scope ref AlgorithmIdentifier algorithm, scope ref CryptoKey key, scope ref BufferSource data) {
660     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "encrypt", "SumType!(Handle,string);Handle;Handle", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), cast(Handle)key.handle, cast(Handle)data.handle)));
661   }
662   auto decrypt()(scope ref AlgorithmIdentifier algorithm, scope ref CryptoKey key, scope ref BufferSource data) {
663     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "decrypt", "SumType!(Handle,string);Handle;Handle", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), cast(Handle)key.handle, cast(Handle)data.handle)));
664   }
665   auto sign()(scope ref AlgorithmIdentifier algorithm, scope ref CryptoKey key, scope ref BufferSource data) {
666     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "sign", "SumType!(Handle,string);Handle;Handle", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), cast(Handle)key.handle, cast(Handle)data.handle)));
667   }
668   auto verify()(scope ref AlgorithmIdentifier algorithm, scope ref CryptoKey key, scope ref BufferSource signature, scope ref BufferSource data) {
669     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "verify", "SumType!(Handle,string);Handle;Handle;Handle", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), cast(Handle)key.handle, cast(Handle)signature.handle, cast(Handle)data.handle)));
670   }
671   auto digest()(scope ref AlgorithmIdentifier algorithm, scope ref BufferSource data) {
672     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "digest", "SumType!(Handle,string);Handle", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), cast(Handle)data.handle)));
673   }
674   auto generateKey()(scope ref AlgorithmIdentifier algorithm, bool extractable, scope ref Sequence!(string) keyUsages) {
675     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "generateKey", "SumType!(Handle,string);bool;Handle", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), extractable, cast(Handle)keyUsages.handle)));
676   }
677   auto deriveKey()(scope ref AlgorithmIdentifier algorithm, scope ref CryptoKey baseKey, scope ref AlgorithmIdentifier derivedKeyType, bool extractable, scope ref Sequence!(string) keyUsages) {
678     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "deriveKey", "SumType!(Handle,string);Handle;SumType!(Handle,string);bool;Handle", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), cast(Handle)baseKey.handle, libwasm.sumtype.match!(((ref derivedKeyType.Types[0] v) => 0),((string v) => 1))(derivedKeyType),tuple(libwasm.sumtype.match!(((ref derivedKeyType.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(derivedKeyType),libwasm.sumtype.match!(((ref derivedKeyType.Types[0] v) => string.init),((string v) => v))(derivedKeyType)), extractable, cast(Handle)keyUsages.handle)));
679   }
680   auto deriveBits()(scope ref AlgorithmIdentifier algorithm, scope ref CryptoKey baseKey, uint length) {
681     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "deriveBits", "SumType!(Handle,string);Handle;uint", tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), cast(Handle)baseKey.handle, length)));
682   }
683   auto importKey()(string format, scope ref JsObject keyData, scope ref AlgorithmIdentifier algorithm, bool extractable, scope ref Sequence!(string) keyUsages) {
684     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "importKey", "string;Handle;SumType!(Handle,string);bool;Handle", tuple(format, cast(Handle)keyData.handle, libwasm.sumtype.match!(((ref algorithm.Types[0] v) => 0),((string v) => 1))(algorithm),tuple(libwasm.sumtype.match!(((ref algorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(algorithm),libwasm.sumtype.match!(((ref algorithm.Types[0] v) => string.init),((string v) => v))(algorithm)), extractable, cast(Handle)keyUsages.handle)));
685   }
686   auto exportKey()(string format, scope ref CryptoKey key) {
687     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "exportKey", "string;Handle", tuple(format, cast(Handle)key.handle)));
688   }
689   auto wrapKey()(string format, scope ref CryptoKey key, scope ref CryptoKey wrappingKey, scope ref AlgorithmIdentifier wrapAlgorithm) {
690     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "wrapKey", "string;Handle;Handle;SumType!(Handle,string)", tuple(format, cast(Handle)key.handle, cast(Handle)wrappingKey.handle, libwasm.sumtype.match!(((ref wrapAlgorithm.Types[0] v) => 0),((string v) => 1))(wrapAlgorithm),tuple(libwasm.sumtype.match!(((ref wrapAlgorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(wrapAlgorithm),libwasm.sumtype.match!(((ref wrapAlgorithm.Types[0] v) => string.init),((string v) => v))(wrapAlgorithm)))));
691   }
692   auto unwrapKey()(string format, scope ref BufferSource wrappedKey, scope ref CryptoKey unwrappingKey, scope ref AlgorithmIdentifier unwrapAlgorithm, scope ref AlgorithmIdentifier unwrappedKeyAlgorithm, bool extractable, scope ref Sequence!(string) keyUsages) {
693     return JsPromise!(Any)(Serialize_Object_VarArgCall!Handle(this.handle, "unwrapKey", "string;Handle;Handle;SumType!(Handle,string);SumType!(Handle,string);bool;Handle", tuple(format, cast(Handle)wrappedKey.handle, cast(Handle)unwrappingKey.handle, libwasm.sumtype.match!(((ref unwrapAlgorithm.Types[0] v) => 0),((string v) => 1))(unwrapAlgorithm),tuple(libwasm.sumtype.match!(((ref unwrapAlgorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(unwrapAlgorithm),libwasm.sumtype.match!(((ref unwrapAlgorithm.Types[0] v) => string.init),((string v) => v))(unwrapAlgorithm)), libwasm.sumtype.match!(((ref unwrappedKeyAlgorithm.Types[0] v) => 0),((string v) => 1))(unwrappedKeyAlgorithm),tuple(libwasm.sumtype.match!(((ref unwrappedKeyAlgorithm.Types[0] v) => cast(Handle)v.handle),((string v) => Handle.init))(unwrappedKeyAlgorithm),libwasm.sumtype.match!(((ref unwrappedKeyAlgorithm.Types[0] v) => string.init),((string v) => v))(unwrappedKeyAlgorithm)), extractable, cast(Handle)keyUsages.handle)));
694   }
695 }
696 
697 
698 extern (C) ubyte AesCtrParams_length_Get(Handle);
699 extern (C) ubyte AesGcmParams_tagLength_Get(Handle);