| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ | 5 #ifndef IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ |
| 6 #define IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ | 6 #define IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| 11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "ios/web/public/security_style.h" | 13 #include "ios/web/public/security_style.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 class SSLInfo; | 16 class SSLInfo; |
| 17 class X509Certificate; | 17 class X509Certificate; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace web { | 20 namespace web { |
| 21 | 21 |
| 22 // NSErrorPeerCertificateChainKey from NSError's userInfo dict. | 22 // NSErrorPeerCertificateChainKey from NSError's userInfo dict. |
| 23 extern NSString* const kNSErrorPeerCertificateChainKey; | 23 extern NSString* const kNSErrorPeerCertificateChainKey; |
| 24 // NSErrorFailingURLKey from NSError's userInfo dict. |
| 25 extern NSString* const kNSErrorFailingURLKey; |
| 24 | 26 |
| 25 // Creates a certificate from an array of SecCertificateRef objects. | 27 // Creates a certificate from an array of SecCertificateRef objects. |
| 26 // Returns null if |certs| is nil or empty. | 28 // Returns null if |certs| is nil or empty. |
| 27 scoped_refptr<net::X509Certificate> CreateCertFromChain(NSArray* certs); | 29 scoped_refptr<net::X509Certificate> CreateCertFromChain(NSArray* certs); |
| 28 | 30 |
| 29 // Creates a certificate from a SecTrustRef object. | 31 // Creates a certificate from a SecTrustRef object. |
| 30 // Returns null if trust is null or does not have any certs. | 32 // Returns null if trust is null or does not have any certs. |
| 31 scoped_refptr<net::X509Certificate> CreateCertFromTrust(SecTrustRef trust); | 33 scoped_refptr<net::X509Certificate> CreateCertFromTrust(SecTrustRef trust); |
| 32 | 34 |
| 33 // Creates server trust object from an array of SecCertificateRef objects. | 35 // Creates server trust object from an array of SecCertificateRef objects. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 48 // |web::IsWKWebViewSSLCertError| function. | 50 // |web::IsWKWebViewSSLCertError| function. |
| 49 void GetSSLInfoFromWKWebViewSSLCertError(NSError* error, | 51 void GetSSLInfoFromWKWebViewSSLCertError(NSError* error, |
| 50 net::SSLInfo* ssl_info); | 52 net::SSLInfo* ssl_info); |
| 51 | 53 |
| 52 // Maps SecTrustResultType value to web::SecurityStyle. | 54 // Maps SecTrustResultType value to web::SecurityStyle. |
| 53 SecurityStyle GetSecurityStyleFromTrustResult(SecTrustResultType result); | 55 SecurityStyle GetSecurityStyleFromTrustResult(SecTrustResultType result); |
| 54 | 56 |
| 55 } // namespace web | 57 } // namespace web |
| 56 | 58 |
| 57 #endif // IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ | 59 #endif // IOS_WEB_WEB_STATE_WK_WEB_VIEW_SECURITY_UTIL_H_ |
| OLD | NEW |