| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CERT_CERT_VERIFIER_H_ | 5 #ifndef NET_CERT_CERT_VERIFIER_H_ |
| 6 #define NET_CERT_CERT_VERIFIER_H_ | 6 #define NET_CERT_CERT_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
| 15 #include "net/base/hash_value.h" | 15 #include "net/base/hash_value.h" |
| 16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
| 17 #include "net/cert/x509_certificate.h" | 17 #include "net/cert/x509_certificate.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 class BoundNetLog; | 21 class NetLogWithSource; |
| 22 class CertVerifyResult; | 22 class CertVerifyResult; |
| 23 class CRLSet; | 23 class CRLSet; |
| 24 | 24 |
| 25 // CertVerifier represents a service for verifying certificates. | 25 // CertVerifier represents a service for verifying certificates. |
| 26 // | 26 // |
| 27 // CertVerifiers can handle multiple requests at a time. | 27 // CertVerifiers can handle multiple requests at a time. |
| 28 class NET_EXPORT CertVerifier { | 28 class NET_EXPORT CertVerifier { |
| 29 public: | 29 public: |
| 30 class Request { | 30 class Request { |
| 31 public: | 31 public: |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // the request has completed will cancel it. | 160 // the request has completed will cancel it. |
| 161 // | 161 // |
| 162 // If Verify() completes synchronously then |out_req| *may* be reset to | 162 // If Verify() completes synchronously then |out_req| *may* be reset to |
| 163 // nullptr. However it is not guaranteed that all implementations will reset | 163 // nullptr. However it is not guaranteed that all implementations will reset |
| 164 // it in this case. | 164 // it in this case. |
| 165 virtual int Verify(const RequestParams& params, | 165 virtual int Verify(const RequestParams& params, |
| 166 CRLSet* crl_set, | 166 CRLSet* crl_set, |
| 167 CertVerifyResult* verify_result, | 167 CertVerifyResult* verify_result, |
| 168 const CompletionCallback& callback, | 168 const CompletionCallback& callback, |
| 169 std::unique_ptr<Request>* out_req, | 169 std::unique_ptr<Request>* out_req, |
| 170 const BoundNetLog& net_log) = 0; | 170 const NetLogWithSource& net_log) = 0; |
| 171 | 171 |
| 172 // Returns true if this CertVerifier supports stapled OCSP responses. | 172 // Returns true if this CertVerifier supports stapled OCSP responses. |
| 173 virtual bool SupportsOCSPStapling(); | 173 virtual bool SupportsOCSPStapling(); |
| 174 | 174 |
| 175 // Creates a CertVerifier implementation that verifies certificates using | 175 // Creates a CertVerifier implementation that verifies certificates using |
| 176 // the preferred underlying cryptographic libraries. | 176 // the preferred underlying cryptographic libraries. |
| 177 static std::unique_ptr<CertVerifier> CreateDefault(); | 177 static std::unique_ptr<CertVerifier> CreateDefault(); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 } // namespace net | 180 } // namespace net |
| 181 | 181 |
| 182 #endif // NET_CERT_CERT_VERIFIER_H_ | 182 #endif // NET_CERT_CERT_VERIFIER_H_ |
| OLD | NEW |