001package Torello.Browser.BrowserAPI;
002
003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
004// Java-HTML Imports
005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
006
007import Torello.Browser.*;
008import Torello.Browser.helper.*;
009import Torello.Browser.JavaScriptAPI.*;
010import Torello.JSON.*;
011
012import Torello.Java.ReadOnly.ReadOnlyList;
013import Torello.Java.ReadOnly.ReadOnlyArrayList;
014
015import Torello.JavaDoc.Annotations.StaticFunctional;
016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;
017
018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.Security$$Commands;
019
020
021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
022// JDK Imports
023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
024
025import javax.json.JsonObject;
026import javax.json.JsonValue;
027
028/**
029 * <SPAN CLASS=COPIEDJDK><B>Security</B></SPAN>
030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
031 */
032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
033public class Security
034{
035    // No Pubic Constructors
036    private Security() { }
037
038
039    // ********************************************************************************************
040    // ********************************************************************************************
041    // Eliminated Types
042    // ********************************************************************************************
043    // ********************************************************************************************
044
045
046    /**
047     * An internal certificate ID value.
048
049     * <EMBED CLASS='external-html' DATA-CTAS='int' DATA-FILE-ID=CDP.EliminatedType
050     *     DATA-NAME=CertificateId>
051     */
052    public static final String CertificateId =
053        "CertificateId has been eliminated.\n" +
054        "It was replaced with the standard Java-Type: int";
055
056
057    // ********************************************************************************************
058    // ********************************************************************************************
059    // Enumerated String Constants Lists
060    // ********************************************************************************************
061    // ********************************************************************************************
062
063
064    /**
065     * The action to take when a certificate error occurs. continue will continue processing the
066     * request and cancel will cancel the request.
067     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
068     */
069    public static final ReadOnlyList<String> CertificateErrorAction = new ReadOnlyArrayList<>
070        (String.class, "cancel", "continue");
071
072    /**
073     * A description of mixed content (HTTP resources on HTTPS pages), as defined by
074     * https://www.w3.org/TR/mixed-content/#categories
075     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
076     */
077    public static final ReadOnlyList<String> MixedContentType = new ReadOnlyArrayList<>
078        (String.class, "blockable", "none", "optionally-blockable");
079
080    /**
081     * <CODE>[No Description Provided by Google]</CODE>
082     * 
083     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
084     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
085     */
086    public static final ReadOnlyList<String> SafetyTipStatus = new ReadOnlyArrayList<>
087        (String.class, "badReputation", "lookalike");
088
089    /**
090     * The security level of a page or resource.
091     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
092     */
093    public static final ReadOnlyList<String> SecurityState = new ReadOnlyArrayList<>
094        (String.class, "info", "insecure", "insecure-broken", "neutral", "secure", "unknown");
095
096
097
098    // ********************************************************************************************
099    // ********************************************************************************************
100    // Basic Types
101    // ********************************************************************************************
102    // ********************************************************************************************
103
104
105    /**
106     * Details about the security state of the page certificate.
107     * 
108     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
109     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
110     */
111    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
112    public static class CertificateSecurityState
113        extends BaseType<CertificateSecurityState>
114        implements java.io.Serializable
115    {
116        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
117        protected static final long serialVersionUID = 1;
118
119        private static final NestedHelper<Security.CertificateSecurityState> singleton =
120            Torello.Browser.BrowserAPI.NestedHelpers.Types.
121                Security$$CertificateSecurityState$$.singleton;
122
123        /** Protocol name (e.g. "TLS 1.2" or "QUIC"). */
124        public final String protocol;
125
126        /** Key Exchange used by the connection, or the empty string if not applicable. */
127        public final String keyExchange;
128
129        /**
130         * (EC)DH group used by the connection, if applicable.
131         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
132         */
133        public final String keyExchangeGroup;
134
135        /** Cipher name. */
136        public final String cipher;
137
138        /**
139         * TLS MAC. Note that AEAD ciphers do not have separate MACs.
140         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
141         */
142        public final String mac;
143
144        /** Page certificate. */
145        public final String[] certificate;
146
147        /** Certificate subject name. */
148        public final String subjectName;
149
150        /** Name of the issuing CA. */
151        public final String issuer;
152
153        /** Certificate valid from date. */
154        public final Number validFrom;
155
156        /** Certificate valid to (expiration) date */
157        public final Number validTo;
158
159        /**
160         * The highest priority network error code, if the certificate has an error.
161         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
162         */
163        public final String certificateNetworkError;
164
165        /** True if the certificate uses a weak signature algorithm. */
166        public final boolean certificateHasWeakSignature;
167
168        /** True if the certificate has a SHA1 signature in the chain. */
169        public final boolean certificateHasSha1Signature;
170
171        /** True if modern SSL */
172        public final boolean modernSSL;
173
174        /** True if the connection is using an obsolete SSL protocol. */
175        public final boolean obsoleteSslProtocol;
176
177        /** True if the connection is using an obsolete SSL key exchange. */
178        public final boolean obsoleteSslKeyExchange;
179
180        /** True if the connection is using an obsolete SSL cipher. */
181        public final boolean obsoleteSslCipher;
182
183        /** True if the connection is using an obsolete SSL signature. */
184        public final boolean obsoleteSslSignature;
185
186        /** Constructor.  Please review this class' fields for documentation. */
187        public CertificateSecurityState(
188                ReadOnlyList<Boolean> isPresent, String protocol, String keyExchange,
189                String keyExchangeGroup, String cipher, String mac, String[] certificate,
190                String subjectName, String issuer, Number validFrom, Number validTo,
191                String certificateNetworkError, boolean certificateHasWeakSignature,
192                boolean certificateHasSha1Signature, boolean modernSSL,
193                boolean obsoleteSslProtocol, boolean obsoleteSslKeyExchange,
194                boolean obsoleteSslCipher, boolean obsoleteSslSignature
195            )
196        {
197            super(singleton, Domains.Security, "CertificateSecurityState", 18);
198
199            this.protocol                       = protocol;
200            this.keyExchange                    = keyExchange;
201            this.keyExchangeGroup               = keyExchangeGroup;
202            this.cipher                         = cipher;
203            this.mac                            = mac;
204            this.certificate                    = certificate;
205            this.subjectName                    = subjectName;
206            this.issuer                         = issuer;
207            this.validFrom                      = validFrom;
208            this.validTo                        = validTo;
209            this.certificateNetworkError        = certificateNetworkError;
210            this.certificateHasWeakSignature    = certificateHasWeakSignature;
211            this.certificateHasSha1Signature    = certificateHasSha1Signature;
212            this.modernSSL                      = modernSSL;
213            this.obsoleteSslProtocol            = obsoleteSslProtocol;
214            this.obsoleteSslKeyExchange         = obsoleteSslKeyExchange;
215            this.obsoleteSslCipher              = obsoleteSslCipher;
216            this.obsoleteSslSignature           = obsoleteSslSignature;
217
218            this.isPresent = (isPresent == null)
219                ? singleton.generateIsPresentList(this)
220                : THROWS.check(isPresent, 18, "Security.CertificateSecurityState");
221        }
222
223        /** Creates an instance of this class from a {@link JsonObject}.*/
224        public static CertificateSecurityState fromJSON(JsonObject jo)
225        { return singleton.fromJSON(jo); }
226
227        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
228        public static NestedDescriptor<CertificateSecurityState> descriptor()
229        { return singleton.descriptor(); }
230    }
231
232    /**
233     * Information about insecure content on the page.
234     * 
235     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
236     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
237     */
238    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
239    public static class InsecureContentStatus
240        extends BaseType<InsecureContentStatus>
241        implements java.io.Serializable
242    {
243        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
244        protected static final long serialVersionUID = 1;
245
246        private static final NestedHelper<Security.InsecureContentStatus> singleton =
247            Torello.Browser.BrowserAPI.NestedHelpers.Types.
248                Security$$InsecureContentStatus$$.singleton;
249
250        /** Always false. */
251        public final boolean ranMixedContent;
252
253        /** Always false. */
254        public final boolean displayedMixedContent;
255
256        /** Always false. */
257        public final boolean containedMixedForm;
258
259        /** Always false. */
260        public final boolean ranContentWithCertErrors;
261
262        /** Always false. */
263        public final boolean displayedContentWithCertErrors;
264
265        /**
266         * Always set to unknown.
267         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=ranInsecureContentStyle DATA-FILE-ID=CDP.EL2>
268         * @see BaseType#enumStrList(String)
269         */
270        public final String ranInsecureContentStyle;
271
272        /**
273         * Always set to unknown.
274         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=displayedInsecureContentStyle DATA-FILE-ID=CDP.EL2>
275         * @see BaseType#enumStrList(String)
276         */
277        public final String displayedInsecureContentStyle;
278
279        /** Constructor.  Please review this class' fields for documentation. */
280        public InsecureContentStatus(
281                ReadOnlyList<Boolean> isPresent, boolean ranMixedContent,
282                boolean displayedMixedContent, boolean containedMixedForm,
283                boolean ranContentWithCertErrors, boolean displayedContentWithCertErrors,
284                String ranInsecureContentStyle, String displayedInsecureContentStyle
285            )
286        {
287            super(singleton, Domains.Security, "InsecureContentStatus", 7);
288
289            this.ranMixedContent                = ranMixedContent;
290            this.displayedMixedContent          = displayedMixedContent;
291            this.containedMixedForm             = containedMixedForm;
292            this.ranContentWithCertErrors       = ranContentWithCertErrors;
293            this.displayedContentWithCertErrors = displayedContentWithCertErrors;
294            this.ranInsecureContentStyle        = ranInsecureContentStyle;
295            this.displayedInsecureContentStyle  = displayedInsecureContentStyle;
296
297            this.isPresent = (isPresent == null)
298                ? singleton.generateIsPresentList(this)
299                : THROWS.check(isPresent, 7, "Security.InsecureContentStatus");
300        }
301
302        /** Creates an instance of this class from a {@link JsonObject}.*/
303        public static InsecureContentStatus fromJSON(JsonObject jo)
304        { return singleton.fromJSON(jo); }
305
306        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
307        public static NestedDescriptor<InsecureContentStatus> descriptor()
308        { return singleton.descriptor(); }
309    }
310
311    /**
312     * <CODE>[No Description Provided by Google]</CODE>
313     * 
314     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
315     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
316     */
317    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
318    public static class SafetyTipInfo
319        extends BaseType<SafetyTipInfo>
320        implements java.io.Serializable
321    {
322        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
323        protected static final long serialVersionUID = 1;
324
325        private static final NestedHelper<Security.SafetyTipInfo> singleton =
326            Torello.Browser.BrowserAPI.NestedHelpers.Types.
327                Security$$SafetyTipInfo$$.singleton;
328
329        /**
330         * Describes whether the page triggers any safety tips or reputation warnings. Default is unknown.
331         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SafetyTipStatus DATA-F=safetyTipStatus DATA-FILE-ID=CDP.EL2>
332         * @see BaseType#enumStrList(String)
333         */
334        public final String safetyTipStatus;
335
336        /**
337         * The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches.
338         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
339         */
340        public final String safeUrl;
341
342        /** Constructor.  Please review this class' fields for documentation. */
343        public SafetyTipInfo
344            (ReadOnlyList<Boolean> isPresent, String safetyTipStatus, String safeUrl)
345        {
346            super(singleton, Domains.Security, "SafetyTipInfo", 2);
347
348            this.safetyTipStatus    = safetyTipStatus;
349            this.safeUrl            = safeUrl;
350
351            this.isPresent = (isPresent == null)
352                ? singleton.generateIsPresentList(this)
353                : THROWS.check(isPresent, 2, "Security.SafetyTipInfo");
354        }
355
356        /** Creates an instance of this class from a {@link JsonObject}.*/
357        public static SafetyTipInfo fromJSON(JsonObject jo)
358        { return singleton.fromJSON(jo); }
359
360        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
361        public static NestedDescriptor<SafetyTipInfo> descriptor()
362        { return singleton.descriptor(); }
363    }
364
365    /**
366     * An explanation of an factor contributing to the security state.
367     * 
368     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
369     */
370    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
371    public static class SecurityStateExplanation
372        extends BaseType<SecurityStateExplanation>
373        implements java.io.Serializable
374    {
375        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
376        protected static final long serialVersionUID = 1;
377
378        private static final NestedHelper<Security.SecurityStateExplanation> singleton =
379            Torello.Browser.BrowserAPI.NestedHelpers.Types.
380                Security$$SecurityStateExplanation$$.singleton;
381
382        /**
383         * Security state representing the severity of the factor being explained.
384         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=securityState DATA-FILE-ID=CDP.EL2>
385         * @see BaseType#enumStrList(String)
386         */
387        public final String securityState;
388
389        /** Title describing the type of factor. */
390        public final String title;
391
392        /** Short phrase describing the type of factor. */
393        public final String summary;
394
395        /** Full text explanation of the factor. */
396        public final String description;
397
398        /**
399         * The type of mixed content described by the explanation.
400         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=MixedContentType DATA-F=mixedContentType DATA-FILE-ID=CDP.EL2>
401         * @see BaseType#enumStrList(String)
402         */
403        public final String mixedContentType;
404
405        /** Page certificate. */
406        public final String[] certificate;
407
408        /**
409         * Recommendations to fix any issues.
410         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
411         */
412        public final String[] recommendations;
413
414        /** Constructor.  Please review this class' fields for documentation. */
415        public SecurityStateExplanation(
416                ReadOnlyList<Boolean> isPresent, String securityState, String title,
417                String summary, String description, String mixedContentType, String[] certificate,
418                String[] recommendations
419            )
420        {
421            super(singleton, Domains.Security, "SecurityStateExplanation", 7);
422
423            this.securityState      = securityState;
424            this.title              = title;
425            this.summary            = summary;
426            this.description        = description;
427            this.mixedContentType   = mixedContentType;
428            this.certificate        = certificate;
429            this.recommendations    = recommendations;
430
431            this.isPresent = (isPresent == null)
432                ? singleton.generateIsPresentList(this)
433                : THROWS.check(isPresent, 7, "Security.SecurityStateExplanation");
434        }
435
436        /** Creates an instance of this class from a {@link JsonObject}.*/
437        public static SecurityStateExplanation fromJSON(JsonObject jo)
438        { return singleton.fromJSON(jo); }
439
440        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
441        public static NestedDescriptor<SecurityStateExplanation> descriptor()
442        { return singleton.descriptor(); }
443    }
444
445    /**
446     * Security state information about the page.
447     * 
448     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
449     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
450     */
451    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
452    public static class VisibleSecurityState
453        extends BaseType<VisibleSecurityState>
454        implements java.io.Serializable
455    {
456        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
457        protected static final long serialVersionUID = 1;
458
459        private static final NestedHelper<Security.VisibleSecurityState> singleton =
460            Torello.Browser.BrowserAPI.NestedHelpers.Types.
461                Security$$VisibleSecurityState$$.singleton;
462
463        /**
464         * The security level of the page.
465         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=securityState DATA-FILE-ID=CDP.EL2>
466         * @see BaseType#enumStrList(String)
467         */
468        public final String securityState;
469
470        /**
471         * Security state details about the page certificate.
472         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
473         */
474        public final Security.CertificateSecurityState certificateSecurityState;
475
476        /**
477         * 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.
478         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
479         */
480        public final Security.SafetyTipInfo safetyTipInfo;
481
482        /** Array of security state issues ids. */
483        public final String[] securityStateIssueIds;
484
485        /** Constructor.  Please review this class' fields for documentation. */
486        public VisibleSecurityState(
487                ReadOnlyList<Boolean> isPresent, String securityState,
488                CertificateSecurityState certificateSecurityState, SafetyTipInfo safetyTipInfo,
489                String[] securityStateIssueIds
490            )
491        {
492            super(singleton, Domains.Security, "VisibleSecurityState", 4);
493
494            this.securityState              = securityState;
495            this.certificateSecurityState   = certificateSecurityState;
496            this.safetyTipInfo              = safetyTipInfo;
497            this.securityStateIssueIds      = securityStateIssueIds;
498
499            this.isPresent = (isPresent == null)
500                ? singleton.generateIsPresentList(this)
501                : THROWS.check(isPresent, 4, "Security.VisibleSecurityState");
502        }
503
504        /** Creates an instance of this class from a {@link JsonObject}.*/
505        public static VisibleSecurityState fromJSON(JsonObject jo)
506        { return singleton.fromJSON(jo); }
507
508        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
509        public static NestedDescriptor<VisibleSecurityState> descriptor()
510        { return singleton.descriptor(); }
511    }
512
513
514    // ********************************************************************************************
515    // ********************************************************************************************
516    // Event Types
517    // ********************************************************************************************
518    // ********************************************************************************************
519
520
521    /**
522     * There is a certificate error. If overriding certificate errors is enabled, then it should be
523     * handled with the <CODE>handleCertificateError</CODE> command. Note: this event does not fire if the
524     * certificate error has been allowed internally. Only one client per target should override
525     * certificate errors at the same time.
526     * 
527     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
528     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
529     */
530    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
531    public static class certificateError
532        extends BrowserEvent<certificateError>
533        implements java.io.Serializable
534    {
535        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
536        protected static final long serialVersionUID = 1;
537
538        private static final NestedHelper<Security.certificateError> singleton =
539            Torello.Browser.BrowserAPI.NestedHelpers.Events.
540                Security$$certificateError$$.singleton;
541
542        /** The ID of the event. */
543        public final int eventId;
544
545        /** The type of the error. */
546        public final String errorType;
547
548        /** The url that was requested. */
549        public final String requestURL;
550
551        /** Constructor.  Please review this class' fields for documentation. */
552        public certificateError
553            (ReadOnlyList<Boolean> isPresent, int eventId, String errorType, String requestURL)
554        {
555            super(singleton, Domains.Security, "certificateError", 3);
556
557            this.eventId    = eventId;
558            this.errorType  = errorType;
559            this.requestURL = requestURL;
560
561            this.isPresent = (isPresent == null)
562                ? singleton.generateIsPresentList(this)
563                : THROWS.check(isPresent, 3, "Security.certificateError");
564        }
565
566        /** Creates an instance of this class from a {@link JsonObject}.*/
567        public static certificateError fromJSON(JsonObject jo)
568        { return singleton.fromJSON(jo); }
569
570        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
571        public static NestedDescriptor<certificateError> descriptor()
572        { return singleton.descriptor(); }
573    }
574
575    /**
576     * The security state of the page changed. No longer being sent.
577     * 
578     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
579     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
580     */
581    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
582    public static class securityStateChanged
583        extends BrowserEvent<securityStateChanged>
584        implements java.io.Serializable
585    {
586        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
587        protected static final long serialVersionUID = 1;
588
589        private static final NestedHelper<Security.securityStateChanged> singleton =
590            Torello.Browser.BrowserAPI.NestedHelpers.Events.
591                Security$$securityStateChanged$$.singleton;
592
593        /**
594         * Security state.
595         * <EMBED CLASS='external-html' DATA-D=Security DATA-C=SecurityState DATA-F=securityState DATA-FILE-ID=CDP.EL2>
596         * @see BaseType#enumStrList(String)
597         */
598        public final String securityState;
599
600        /**
601         * True if the page was loaded over cryptographic transport such as HTTPS.
602         * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
603         */
604        public final boolean schemeIsCryptographic;
605
606        /**
607         * Previously a list of explanations for the security state. Now always
608         * empty.
609         * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
610         */
611        public final Security.SecurityStateExplanation[] explanations;
612
613        /**
614         * Information about insecure content on the page.
615         * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
616         */
617        public final Security.InsecureContentStatus insecureContentStatus;
618
619        /**
620         * Overrides user-visible description of the state. Always omitted.
621         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Dep-Top>DEPRECATED</B>
622         */
623        public final String summary;
624
625        /** Constructor.  Please review this class' fields for documentation. */
626        public securityStateChanged(
627                ReadOnlyList<Boolean> isPresent, String securityState,
628                boolean schemeIsCryptographic, SecurityStateExplanation[] explanations,
629                InsecureContentStatus insecureContentStatus, String summary
630            )
631        {
632            super(singleton, Domains.Security, "securityStateChanged", 5);
633
634            this.securityState          = securityState;
635            this.schemeIsCryptographic  = schemeIsCryptographic;
636            this.explanations           = explanations;
637            this.insecureContentStatus  = insecureContentStatus;
638            this.summary                = summary;
639
640            this.isPresent = (isPresent == null)
641                ? singleton.generateIsPresentList(this)
642                : THROWS.check(isPresent, 5, "Security.securityStateChanged");
643        }
644
645        /** Creates an instance of this class from a {@link JsonObject}.*/
646        public static securityStateChanged fromJSON(JsonObject jo)
647        { return singleton.fromJSON(jo); }
648
649        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
650        public static NestedDescriptor<securityStateChanged> descriptor()
651        { return singleton.descriptor(); }
652    }
653
654    /**
655     * The security state of the page changed.
656     * 
657     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
658     * <EMBED CLASS=globalDefs DATA-DOMAIN=Security DATA-API=BrowserAPI>
659     */
660    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
661    public static class visibleSecurityStateChanged
662        extends BrowserEvent<visibleSecurityStateChanged>
663        implements java.io.Serializable
664    {
665        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
666        protected static final long serialVersionUID = 1;
667
668        private static final NestedHelper<Security.visibleSecurityStateChanged> singleton =
669            Torello.Browser.BrowserAPI.NestedHelpers.Events.
670                Security$$visibleSecurityStateChanged$$.singleton;
671
672        /** Security state information about the page. */
673        public final Security.VisibleSecurityState visibleSecurityState;
674
675        /** Constructor.  Please review this class' fields for documentation. */
676        public visibleSecurityStateChanged
677            (ReadOnlyList<Boolean> isPresent, VisibleSecurityState visibleSecurityState)
678        {
679            super(singleton, Domains.Security, "visibleSecurityStateChanged", 1);
680
681            this.visibleSecurityState = visibleSecurityState;
682
683            this.isPresent = (isPresent == null)
684                ? singleton.generateIsPresentList(this)
685                : THROWS.check(isPresent, 1, "Security.visibleSecurityStateChanged");
686        }
687
688        /** Creates an instance of this class from a {@link JsonObject}.*/
689        public static visibleSecurityStateChanged fromJSON(JsonObject jo)
690        { return singleton.fromJSON(jo); }
691
692        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
693        public static NestedDescriptor<visibleSecurityStateChanged> descriptor()
694        { return singleton.descriptor(); }
695    }
696
697
698
699
700    // ********************************************************************************************
701    // ********************************************************************************************
702    // Commands
703    // ********************************************************************************************
704    // ********************************************************************************************
705
706
707    /**
708     * Disables tracking security state changes.
709     * 
710     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
711     *
712     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
713     * browser receives the invocation-request.
714     *
715     * <BR /><BR /><DIV CLASS=JDHint>
716     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
717     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
718     * the Browser Function has run to completion.
719     * </DIV>
720     */
721    public static Script<Void> disable()
722    {
723        // Ultra-Simple Request JSON - Because this method has no parameters
724        final String requestJSON = "{\"method\":\"Security.disable\"}";
725
726        return Script.NO_RET(Domains.Security, "disable", requestJSON);
727    }
728
729    /**
730     * Enables tracking security state changes.
731     * 
732     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
733     *
734     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
735     * browser receives the invocation-request.
736     *
737     * <BR /><BR /><DIV CLASS=JDHint>
738     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
739     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
740     * the Browser Function has run to completion.
741     * </DIV>
742     */
743    public static Script<Void> enable()
744    {
745        // Ultra-Simple Request JSON - Because this method has no parameters
746        final String requestJSON = "{\"method\":\"Security.enable\"}";
747
748        return Script.NO_RET(Domains.Security, "enable", requestJSON);
749    }
750
751    /**
752     * Handles a certificate error that fired a certificateError event.
753     * 
754     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
755     * 
756     * @param eventId The ID of the event.
757     * 
758     * @param action The action to take on the certificate error.
759     * 
760     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
761     *
762     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
763     * browser receives the invocation-request.
764     *
765     * <BR /><BR /><DIV CLASS=JDHint>
766     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
767     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
768     * the Browser Function has run to completion.
769     * </DIV>
770     */
771    public static Script<Void> handleCertificateError(int eventId, String action)
772    {
773        // Convert all Method Parameters into a JSON Request-Object (as a String)
774        final String requestJSON = WriteJSON.get(
775            Security$$Commands.handleCertificateError$$, "Security.handleCertificateError",
776            eventId, action
777        );
778
779        return Script.NO_RET(Domains.Security, "handleCertificateError", requestJSON);
780    }
781
782    /**
783     * Enable/disable whether all certificate errors should be ignored.
784     * 
785     * @param ignore If true, all certificate errors will be ignored.
786     * 
787     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
788     *
789     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
790     * browser receives the invocation-request.
791     *
792     * <BR /><BR /><DIV CLASS=JDHint>
793     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
794     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
795     * the Browser Function has run to completion.
796     * </DIV>
797     */
798    public static Script<Void> setIgnoreCertificateErrors(boolean ignore)
799    {
800        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
801        final String requestJSON = WriteJSON.get(
802            CDPTypes.PRIMITIVE_BOOLEAN, "ignore", false, "Security.setIgnoreCertificateErrors",
803            ignore
804        );
805
806        return Script.NO_RET(Domains.Security, "setIgnoreCertificateErrors", requestJSON);
807    }
808
809    /**
810     * Enable/disable overriding certificate errors. If enabled, all certificate error events need to
811     * be handled by the DevTools client and should be answered with <CODE>handleCertificateError</CODE> commands.
812     * 
813     * <BR /><B CLASS=Dep-Top>DEPRECATED</B>
814     * 
815     * @param override If true, certificate errors will be overridden.
816     * 
817     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
818     *
819     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
820     * browser receives the invocation-request.
821     *
822     * <BR /><BR /><DIV CLASS=JDHint>
823     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
824     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
825     * the Browser Function has run to completion.
826     * </DIV>
827     */
828    public static Script<Void> setOverrideCertificateErrors(boolean override)
829    {
830        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
831        final String requestJSON = WriteJSON.get(
832            CDPTypes.PRIMITIVE_BOOLEAN, "override", false,
833            "Security.setOverrideCertificateErrors", override
834        );
835
836        return Script.NO_RET(Domains.Security, "setOverrideCertificateErrors", requestJSON);
837    }
838
839
840}