From: dongsug.song Date: Mon, 5 Aug 2024 12:58:58 +0000 (+0900) Subject: [NUI] Add WebView Certificate policy decision error get and suspend X-Git-Tag: submit/tizen/20240827.074151~1^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ea8651f8d11b3b78135da0c9509ec58a2d1d96d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add WebView Certificate policy decision error get and suspend --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs index b92c22bdf..23e3965db 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WebCertificate.cs @@ -37,6 +37,13 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebCertificate_IsContextSecure")] [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] public static extern bool IsContextSecure(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebCertificate_GetPolicyDecisionError")] + public static extern int GetPolicyDecisionError(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WebCertificate_SuspendPolicyDecision")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool SuspendPolicyDecision(global::System.Runtime.InteropServices.HandleRef jarg1); } } } diff --git a/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs b/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs index 77670409b..06451a371 100755 --- a/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs +++ b/src/Tizen.NUI/src/internal/WebView/WebCertificate.cs @@ -90,5 +90,51 @@ namespace Tizen.NUI Interop.WebCertificate.Allow(SwigCPtr, allowed); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + + /// + /// Get certificate policy decision error. + /// + /// PolicyDecisionErrorType + [EditorBrowsable(EditorBrowsableState.Never)] + public PolicyDecisionErrorType PolicyDecisionError + { + get + { + int result = Interop.WebCertificate.GetPolicyDecisionError(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) return PolicyDecisionErrorType.Unknown; + return (PolicyDecisionErrorType)result; + } + } + + /// + /// Suspend certification policy decision. + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Suspend() + { + bool ret = Interop.WebCertificate.SuspendPolicyDecision(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public enum PolicyDecisionErrorType + { + CommonNameInvalid, //The server responded with a certificate whose common name did not match the host name. + DateInvalid, //The server responded with a certificate that by our clock, appears to either not yet be valid or to have expired. + AuthorityInvalid, // The server responded with a certificate that is signed by an authority we don't trust. + NoRevocationMechanism, // The certificate has no mechanism for determining if it is revoked. In effect, this certificate cannot be revoked. + UnableToCheckRevocation, // Revocation information for the security certificate for this site is not available. + Revoked, // The server responded with a certificate that has been revoked. + Invalid, // The server responded with a certificate that is invalid. + WeakAlgorithm, // The server responded with a certificate that is signed using a weak signature algorithm. + NonUniqueName, // The host name specified in the certificate is not unique. + WeakKey, // The server responded with a certificate that contains a weak key (e.g. a too-small RSA key). + PinnedKeyNotInChain, // The certificate didn't match the public key pins for the host name. + NameViolation, // The certificate claimed DNS names that are in violation of name constraints. + ValidityTooLong, // The certificate's validity period is too long. + Unknown = 1000 // Reported in case of wrong usage of ewk_certificate_policy_decision_error_get API. + } } }