1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
package Torello.Browser.BrowserAPI;

// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Java-HTML Imports
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

import Torello.Browser.*;
import Torello.Browser.helper.*;
import Torello.Browser.JavaScriptAPI.*;
import Torello.JSON.*;

import Torello.Java.ReadOnly.ReadOnlyList;
import Torello.Java.ReadOnly.ReadOnlyArrayList;

import Torello.JavaDoc.Annotations.StaticFunctional;
import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;

import Torello.Browser.BrowserAPI.NestedHelpers.Commands.Security$$Commands;


// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// JDK Imports
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

import javax.json.JsonObject;
import javax.json.JsonValue;

/**
 * <SPAN CLASS=COPIEDJDK><B>Security</B></SPAN>
 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
 */
@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
public class Security
{
    // No Pubic Constructors
    private Security() { }


    // ********************************************************************************************
    // ********************************************************************************************
    // Eliminated Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * An internal certificate ID value.

     * <EMBED CLASS='external-html' DATA-CTAS='int' DATA-FILE-ID=CDP.EliminatedType
     *     DATA-NAME=CertificateId>
     */
    public static final String CertificateId =
        "CertificateId has been eliminated.\n" +
        "It was replaced with the standard Java-Type: int";


    // ********************************************************************************************
    // ********************************************************************************************
    // Enumerated String Constants Lists
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * The action to take when a certificate error occurs. continue will continue processing the
     * request and cancel will cancel the request.
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> CertificateErrorAction = new ReadOnlyArrayList<>
        (String.class, "cancel", "continue");

    /**
     * A description of mixed content (HTTP resources on HTTPS pages), as defined by
     * https://www.w3.org/TR/mixed-content/#categories
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> MixedContentType = new ReadOnlyArrayList<>
        (String.class, "blockable", "none", "optionally-blockable");

    /**
     * <CODE>[No Description Provided by Google]</CODE>
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> SafetyTipStatus = new ReadOnlyArrayList<>
        (String.class, "badReputation", "lookalike");

    /**
     * The security level of a page or resource.
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> SecurityState = new ReadOnlyArrayList<>
        (String.class, "info", "insecure", "insecure-broken", "neutral", "secure", "unknown");



    // ********************************************************************************************
    // ********************************************************************************************
    // Basic Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Details about the security state of the page certificate.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
    public static class CertificateSecurityState
        extends BaseType<CertificateSecurityState>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.CertificateSecurityState> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Types.
                Security$$CertificateSecurityState$$.singleton;

        /** Protocol name (e.g. "TLS 1.2" or "QUIC"). */
        public final String protocol;

        /** Key Exchange used by the connection, or the empty string if not applicable. */
        public final String keyExchange;

        /**
         * (EC)DH group used by the connection, if applicable.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String keyExchangeGroup;

        /** Cipher name. */
        public final String cipher;

        /**
         * TLS MAC. Note that AEAD ciphers do not have separate MACs.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String mac;

        /** Page certificate. */
        public final String[] certificate;

        /** Certificate subject name. */
        public final String subjectName;

        /** Name of the issuing CA. */
        public final String issuer;

        /** Certificate valid from date. */
        public final Number validFrom;

        /** Certificate valid to (expiration) date */
        public final Number validTo;

        /**
         * The highest priority network error code, if the certificate has an error.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String certificateNetworkError;

        /** True if the certificate uses a weak signature algorithm. */
        public final boolean certificateHasWeakSignature;

        /** True if the certificate has a SHA1 signature in the chain. */
        public final boolean certificateHasSha1Signature;

        /** True if modern SSL */
        public final boolean modernSSL;

        /** True if the connection is using an obsolete SSL protocol. */
        public final boolean obsoleteSslProtocol;

        /** True if the connection is using an obsolete SSL key exchange. */
        public final boolean obsoleteSslKeyExchange;

        /** True if the connection is using an obsolete SSL cipher. */
        public final boolean obsoleteSslCipher;

        /** True if the connection is using an obsolete SSL signature. */
        public final boolean obsoleteSslSignature;

        /** Constructor.  Please review this class' fields for documentation. */
        public CertificateSecurityState(
                ReadOnlyList<Boolean> isPresent, String protocol, String keyExchange,
                String keyExchangeGroup, String cipher, String mac, String[] certificate,
                String subjectName, String issuer, Number validFrom, Number validTo,
                String certificateNetworkError, boolean certificateHasWeakSignature,
                boolean certificateHasSha1Signature, boolean modernSSL,
                boolean obsoleteSslProtocol, boolean obsoleteSslKeyExchange,
                boolean obsoleteSslCipher, boolean obsoleteSslSignature
            )
        {
            super(singleton, Domains.Security, "CertificateSecurityState", 18);

            this.protocol                       = protocol;
            this.keyExchange                    = keyExchange;
            this.keyExchangeGroup               = keyExchangeGroup;
            this.cipher                         = cipher;
            this.mac                            = mac;
            this.certificate                    = certificate;
            this.subjectName                    = subjectName;
            this.issuer                         = issuer;
            this.validFrom                      = validFrom;
            this.validTo                        = validTo;
            this.certificateNetworkError        = certificateNetworkError;
            this.certificateHasWeakSignature    = certificateHasWeakSignature;
            this.certificateHasSha1Signature    = certificateHasSha1Signature;
            this.modernSSL                      = modernSSL;
            this.obsoleteSslProtocol            = obsoleteSslProtocol;
            this.obsoleteSslKeyExchange         = obsoleteSslKeyExchange;
            this.obsoleteSslCipher              = obsoleteSslCipher;
            this.obsoleteSslSignature           = obsoleteSslSignature;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 18, "Security.CertificateSecurityState");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static CertificateSecurityState fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<CertificateSecurityState> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * Information about insecure content on the page.
     * 
     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
    public static class InsecureContentStatus
        extends BaseType<InsecureContentStatus>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.InsecureContentStatus> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Types.
                Security$$InsecureContentStatus$$.singleton;

        /** Always false. */
        public final boolean ranMixedContent;

        /** Always false. */
        public final boolean displayedMixedContent;

        /** Always false. */
        public final boolean containedMixedForm;

        /** Always false. */
        public final boolean ranContentWithCertErrors;

        /** Always false. */
        public final boolean displayedContentWithCertErrors;

        /**
         * Always set to unknown.
         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=ranInsecureContentStyle DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String ranInsecureContentStyle;

        /**
         * Always set to unknown.
         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=displayedInsecureContentStyle DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String displayedInsecureContentStyle;

        /** Constructor.  Please review this class' fields for documentation. */
        public InsecureContentStatus(
                ReadOnlyList<Boolean> isPresent, boolean ranMixedContent,
                boolean displayedMixedContent, boolean containedMixedForm,
                boolean ranContentWithCertErrors, boolean displayedContentWithCertErrors,
                String ranInsecureContentStyle, String displayedInsecureContentStyle
            )
        {
            super(singleton, Domains.Security, "InsecureContentStatus", 7);

            this.ranMixedContent                = ranMixedContent;
            this.displayedMixedContent          = displayedMixedContent;
            this.containedMixedForm             = containedMixedForm;
            this.ranContentWithCertErrors       = ranContentWithCertErrors;
            this.displayedContentWithCertErrors = displayedContentWithCertErrors;
            this.ranInsecureContentStyle        = ranInsecureContentStyle;
            this.displayedInsecureContentStyle  = displayedInsecureContentStyle;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 7, "Security.InsecureContentStatus");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static InsecureContentStatus fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<InsecureContentStatus> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * <CODE>[No Description Provided by Google]</CODE>
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
    public static class SafetyTipInfo
        extends BaseType<SafetyTipInfo>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.SafetyTipInfo> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Types.
                Security$$SafetyTipInfo$$.singleton;

        /**
         * Describes whether the page triggers any safety tips or reputation warnings. Default is unknown.
         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SafetyTipStatus DATA-F=safetyTipStatus DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String safetyTipStatus;

        /**
         * The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String safeUrl;

        /** Constructor.  Please review this class' fields for documentation. */
        public SafetyTipInfo
            (ReadOnlyList<Boolean> isPresent, String safetyTipStatus, String safeUrl)
        {
            super(singleton, Domains.Security, "SafetyTipInfo", 2);

            this.safetyTipStatus    = safetyTipStatus;
            this.safeUrl            = safeUrl;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 2, "Security.SafetyTipInfo");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static SafetyTipInfo fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<SafetyTipInfo> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * An explanation of an factor contributing to the security state.
     * 
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
    public static class SecurityStateExplanation
        extends BaseType<SecurityStateExplanation>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.SecurityStateExplanation> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Types.
                Security$$SecurityStateExplanation$$.singleton;

        /**
         * Security state representing the severity of the factor being explained.
         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=securityState DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String securityState;

        /** Title describing the type of factor. */
        public final String title;

        /** Short phrase describing the type of factor. */
        public final String summary;

        /** Full text explanation of the factor. */
        public final String description;

        /**
         * The type of mixed content described by the explanation.
         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=MixedContentType DATA-F=mixedContentType DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String mixedContentType;

        /** Page certificate. */
        public final String[] certificate;

        /**
         * Recommendations to fix any issues.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String[] recommendations;

        /** Constructor.  Please review this class' fields for documentation. */
        public SecurityStateExplanation(
                ReadOnlyList<Boolean> isPresent, String securityState, String title,
                String summary, String description, String mixedContentType, String[] certificate,
                String[] recommendations
            )
        {
            super(singleton, Domains.Security, "SecurityStateExplanation", 7);

            this.securityState      = securityState;
            this.title              = title;
            this.summary            = summary;
            this.description        = description;
            this.mixedContentType   = mixedContentType;
            this.certificate        = certificate;
            this.recommendations    = recommendations;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 7, "Security.SecurityStateExplanation");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static SecurityStateExplanation fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<SecurityStateExplanation> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * Security state information about the page.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
    public static class VisibleSecurityState
        extends BaseType<VisibleSecurityState>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.VisibleSecurityState> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Types.
                Security$$VisibleSecurityState$$.singleton;

        /**
         * The security level of the page.
         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=securityState DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String securityState;

        /**
         * Security state details about the page certificate.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final Security.CertificateSecurityState certificateSecurityState;

        /**
         * The type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final Security.SafetyTipInfo safetyTipInfo;

        /** Array of security state issues ids. */
        public final String[] securityStateIssueIds;

        /** Constructor.  Please review this class' fields for documentation. */
        public VisibleSecurityState(
                ReadOnlyList<Boolean> isPresent, String securityState,
                CertificateSecurityState certificateSecurityState, SafetyTipInfo safetyTipInfo,
                String[] securityStateIssueIds
            )
        {
            super(singleton, Domains.Security, "VisibleSecurityState", 4);

            this.securityState              = securityState;
            this.certificateSecurityState   = certificateSecurityState;
            this.safetyTipInfo              = safetyTipInfo;
            this.securityStateIssueIds      = securityStateIssueIds;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 4, "Security.VisibleSecurityState");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static VisibleSecurityState fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<VisibleSecurityState> descriptor()
        { return singleton.descriptor(); }
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // Event Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * There is a certificate error. If overriding certificate errors is enabled, then it should be
     * handled with the <CODE>handleCertificateError</CODE> command. Note: this event does not fire if the
     * certificate error has been allowed internally. Only one client per target should override
     * certificate errors at the same time.
     * 
     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
    public static class certificateError
        extends BrowserEvent<certificateError>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.certificateError> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Events.
                Security$$certificateError$$.singleton;

        /** The ID of the event. */
        public final int eventId;

        /** The type of the error. */
        public final String errorType;

        /** The url that was requested. */
        public final String requestURL;

        /** Constructor.  Please review this class' fields for documentation. */
        public certificateError
            (ReadOnlyList<Boolean> isPresent, int eventId, String errorType, String requestURL)
        {
            super(singleton, Domains.Security, "certificateError", 3);

            this.eventId    = eventId;
            this.errorType  = errorType;
            this.requestURL = requestURL;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 3, "Security.certificateError");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static certificateError fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<certificateError> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * The security state of the page changed. No longer being sent.
     * 
     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
    public static class securityStateChanged
        extends BrowserEvent<securityStateChanged>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.securityStateChanged> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Events.
                Security$$securityStateChanged$$.singleton;

        /**
         * Security state.
         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=securityState DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String securityState;

        /**
         * True if the page was loaded over cryptographic transport such as HTTPS.
         * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
         */
        public final boolean schemeIsCryptographic;

        /**
         * Previously a list of explanations for the security state. Now always
         * empty.
         * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
         */
        public final Security.SecurityStateExplanation[] explanations;

        /**
         * Information about insecure content on the page.
         * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
         */
        public final Security.InsecureContentStatus insecureContentStatus;

        /**
         * Overrides user-visible description of the state. Always omitted.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Dep-Top>DEPRECATED</B>
         */
        public final String summary;

        /** Constructor.  Please review this class' fields for documentation. */
        public securityStateChanged(
                ReadOnlyList<Boolean> isPresent, String securityState,
                boolean schemeIsCryptographic, SecurityStateExplanation[] explanations,
                InsecureContentStatus insecureContentStatus, String summary
            )
        {
            super(singleton, Domains.Security, "securityStateChanged", 5);

            this.securityState          = securityState;
            this.schemeIsCryptographic  = schemeIsCryptographic;
            this.explanations           = explanations;
            this.insecureContentStatus  = insecureContentStatus;
            this.summary                = summary;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 5, "Security.securityStateChanged");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static securityStateChanged fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<securityStateChanged> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * The security state of the page changed.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
    public static class visibleSecurityStateChanged
        extends BrowserEvent<visibleSecurityStateChanged>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Security.visibleSecurityStateChanged> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Events.
                Security$$visibleSecurityStateChanged$$.singleton;

        /** Security state information about the page. */
        public final Security.VisibleSecurityState visibleSecurityState;

        /** Constructor.  Please review this class' fields for documentation. */
        public visibleSecurityStateChanged
            (ReadOnlyList<Boolean> isPresent, VisibleSecurityState visibleSecurityState)
        {
            super(singleton, Domains.Security, "visibleSecurityStateChanged", 1);

            this.visibleSecurityState = visibleSecurityState;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 1, "Security.visibleSecurityStateChanged");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static visibleSecurityStateChanged fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<visibleSecurityStateChanged> descriptor()
        { return singleton.descriptor(); }
    }




    // ********************************************************************************************
    // ********************************************************************************************
    // Commands
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Disables tracking security state changes.
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> disable()
    {
        // Ultra-Simple Request JSON - Because this method has no parameters
        final String requestJSON = "{\"method\":\"Security.disable\"}";

        return Script.NO_RET(Domains.Security, "disable", requestJSON);
    }

    /**
     * Enables tracking security state changes.
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> enable()
    {
        // Ultra-Simple Request JSON - Because this method has no parameters
        final String requestJSON = "{\"method\":\"Security.enable\"}";

        return Script.NO_RET(Domains.Security, "enable", requestJSON);
    }

    /**
     * Handles a certificate error that fired a certificateError event.
     * 
     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
     * 
     * @param eventId The ID of the event.
     * 
     * @param action The action to take on the certificate error.
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> handleCertificateError(int eventId, String action)
    {
        // Convert all Method Parameters into a JSON Request-Object (as a String)
        final String requestJSON = WriteJSON.get(
            Security$$Commands.handleCertificateError$$, "Security.handleCertificateError",
            eventId, action
        );

        return Script.NO_RET(Domains.Security, "handleCertificateError", requestJSON);
    }

    /**
     * Enable/disable whether all certificate errors should be ignored.
     * 
     * @param ignore If true, all certificate errors will be ignored.
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> setIgnoreCertificateErrors(boolean ignore)
    {
        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
        final String requestJSON = WriteJSON.get(
            CDPTypes.PRIMITIVE_BOOLEAN, "ignore", false, "Security.setIgnoreCertificateErrors",
            ignore
        );

        return Script.NO_RET(Domains.Security, "setIgnoreCertificateErrors", requestJSON);
    }

    /**
     * Enable/disable overriding certificate errors. If enabled, all certificate error events need to
     * be handled by the DevTools client and should be answered with <CODE>handleCertificateError</CODE> commands.
     * 
     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
     * 
     * @param override If true, certificate errors will be overridden.
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> setOverrideCertificateErrors(boolean override)
    {
        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
        final String requestJSON = WriteJSON.get(
            CDPTypes.PRIMITIVE_BOOLEAN, "override", false,
            "Security.setOverrideCertificateErrors", override
        );

        return Script.NO_RET(Domains.Security, "setOverrideCertificateErrors", requestJSON);
    }


}