Index: ios/web/web_state/wk_web_view_security_util.h |
diff --git a/ios/web/web_state/wk_web_view_security_util.h b/ios/web/web_state/wk_web_view_security_util.h |
index 07f32661917cbde24d6c3b1de8047230177637b8..1e5f0102cd00c40b55ca9528af6bca91bf78809c 100644 |
--- a/ios/web/web_state/wk_web_view_security_util.h |
+++ b/ios/web/web_state/wk_web_view_security_util.h |
@@ -6,8 +6,11 @@ |
#define IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ |
#import <Foundation/Foundation.h> |
+#include <Security/Security.h> |
+#include "base/mac/scoped_cftyperef.h" |
#include "base/memory/ref_counted.h" |
+#include "ios/web/public/security_style.h" |
namespace net { |
class SSLInfo; |
@@ -27,6 +30,11 @@ scoped_refptr<net::X509Certificate> CreateCertFromChain(NSArray* certs); |
// Returns null if trust is null or does not have any certs. |
scoped_refptr<net::X509Certificate> CreateCertFromTrust(SecTrustRef trust); |
+// Creates server trust object from an array of SecCertificateRef objects. |
+// Returns null if |certs| is null or empty. |
+base::ScopedCFTypeRef<SecTrustRef> CreateServerTrustFromChain(NSArray* certs, |
+ NSString* host); |
+ |
// Makes SecTrustEvaluate call to return kSecTrustResultProceed. |
// Should be called only if the user expilitely agreed to proceed with |trust| |
// or trust represents a valid certificate chain. |
@@ -40,6 +48,9 @@ BOOL IsWKWebViewSSLError(NSError* error); |
// |web::IsSSLError| function. |
void GetSSLInfoFromWKWebViewSSLError(NSError* error, net::SSLInfo* ssl_info); |
+// Maps SecTrustResultType value to web::SecurityStyle. |
+SecurityStyle GetSecurityStyleFromTrustResult(SecTrustResultType result); |
+ |
} // namespace web |
#endif // IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ |