OLD | NEW |
1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008-2009 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 NET_BASE_CERT_VERIFIER_H_ | 5 #ifndef NET_BASE_CERT_VERIFIER_H_ |
6 #define NET_BASE_CERT_VERIFIER_H_ | 6 #define NET_BASE_CERT_VERIFIER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // Verifies the given certificate against the given hostname. Returns OK if | 34 // Verifies the given certificate against the given hostname. Returns OK if |
35 // successful or an error code upon failure. | 35 // successful or an error code upon failure. |
36 // | 36 // |
37 // The |*verify_result| structure, including the |verify_result->cert_status| | 37 // The |*verify_result| structure, including the |verify_result->cert_status| |
38 // bitmask, is always filled out regardless of the return value. If the | 38 // bitmask, is always filled out regardless of the return value. If the |
39 // certificate has multiple errors, the corresponding status flags are set in | 39 // certificate has multiple errors, the corresponding status flags are set in |
40 // |verify_result->cert_status|, and the error code for the most serious | 40 // |verify_result->cert_status|, and the error code for the most serious |
41 // error is returned. | 41 // error is returned. |
42 // | 42 // |
43 // |flags| is bitwise OR'd of X509Certificate::VerifyFlags. | 43 // |flags| is bitwise OR'd of x509_chain::VerifyFlags. |
44 // If VERIFY_REV_CHECKING_ENABLED is set in |flags|, certificate revocation | 44 // If VERIFY_REV_CHECKING_ENABLED is set in |flags|, certificate revocation |
45 // checking is performed. | 45 // checking is performed. |
46 // | 46 // |
47 // If VERIFY_EV_CERT is set in |flags| too, EV certificate verification is | 47 // If VERIFY_EV_CERT is set in |flags| too, EV certificate verification is |
48 // performed. If |flags| is VERIFY_EV_CERT (that is, | 48 // performed. If |flags| is VERIFY_EV_CERT (that is, |
49 // VERIFY_REV_CHECKING_ENABLED is not set), EV certificate verification will | 49 // VERIFY_REV_CHECKING_ENABLED is not set), EV certificate verification will |
50 // not be performed. | 50 // not be performed. |
51 // | 51 // |
52 // When callback is null, the operation completes synchronously. | 52 // When callback is null, the operation completes synchronously. |
53 // | 53 // |
54 // When callback is non-null, ERR_IO_PENDING is returned if the operation | 54 // When callback is non-null, ERR_IO_PENDING is returned if the operation |
55 // could not be completed synchronously, in which case the result code will | 55 // could not be completed synchronously, in which case the result code will |
56 // be passed to the callback when available. | 56 // be passed to the callback when available. |
57 // | 57 // |
58 int Verify(X509Certificate* cert, const std::string& hostname, | 58 int Verify(X509Certificate* cert, const std::string& hostname, |
59 int flags, CertVerifyResult* verify_result, | 59 int flags, CertVerifyResult* verify_result, |
60 CompletionCallback* callback); | 60 CompletionCallback* callback); |
61 | 61 |
62 private: | 62 private: |
63 class Request; | 63 class Request; |
64 friend class Request; | 64 friend class Request; |
65 scoped_refptr<Request> request_; | 65 scoped_refptr<Request> request_; |
66 DISALLOW_COPY_AND_ASSIGN(CertVerifier); | 66 DISALLOW_COPY_AND_ASSIGN(CertVerifier); |
67 }; | 67 }; |
68 | 68 |
69 } // namespace net | 69 } // namespace net |
70 | 70 |
71 #endif // NET_BASE_CERT_VERIFIER_H_ | 71 #endif // NET_BASE_CERT_VERIFIER_H_ |
OLD | NEW |