OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CT_VERIFIER_H_ | 5 #ifndef NET_CERT_CT_VERIFIER_H_ |
6 #define NET_CERT_CT_VERIFIER_H_ | 6 #define NET_CERT_CT_VERIFIER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 | 13 |
14 namespace ct { | 14 namespace ct { |
15 struct CTVerifyResult; | 15 struct CTVerifyResult; |
16 struct SignedCertificateTimestamp; | 16 struct SignedCertificateTimestamp; |
17 } // namespace ct | 17 } // namespace ct |
18 | 18 |
19 class BoundNetLog; | 19 class NetLogWithSource; |
20 class CTLogVerifier; | 20 class CTLogVerifier; |
21 class X509Certificate; | 21 class X509Certificate; |
22 | 22 |
23 // Interface for verifying Signed Certificate Timestamps over a certificate. | 23 // Interface for verifying Signed Certificate Timestamps over a certificate. |
24 class NET_EXPORT CTVerifier { | 24 class NET_EXPORT CTVerifier { |
25 public: | 25 public: |
26 class NET_EXPORT Observer { | 26 class NET_EXPORT Observer { |
27 public: | 27 public: |
28 // Called for each Signed Certificate Timestamp from a known log that vas | 28 // Called for each Signed Certificate Timestamp from a known log that vas |
29 // verified successfully (i.e. the signature verifies). |sct| is the | 29 // verified successfully (i.e. the signature verifies). |sct| is the |
(...skipping 18 matching lines...) Expand all Loading... |
48 // SCTs. It is expected that most certificates will use only one source | 48 // SCTs. It is expected that most certificates will use only one source |
49 // (embedding, TLS extension or OCSP stapling). If no stapled OCSP response | 49 // (embedding, TLS extension or OCSP stapling). If no stapled OCSP response |
50 // is available, |stapled_ocsp_response| should be an empty string. If no SCT | 50 // is available, |stapled_ocsp_response| should be an empty string. If no SCT |
51 // TLS extension was negotiated, |sct_list_from_tls_extension| should be an | 51 // TLS extension was negotiated, |sct_list_from_tls_extension| should be an |
52 // empty string. |result| will be filled with the SCTs present, divided into | 52 // empty string. |result| will be filled with the SCTs present, divided into |
53 // categories based on the verification result. | 53 // categories based on the verification result. |
54 virtual int Verify(X509Certificate* cert, | 54 virtual int Verify(X509Certificate* cert, |
55 const std::string& stapled_ocsp_response, | 55 const std::string& stapled_ocsp_response, |
56 const std::string& sct_list_from_tls_extension, | 56 const std::string& sct_list_from_tls_extension, |
57 ct::CTVerifyResult* result, | 57 ct::CTVerifyResult* result, |
58 const BoundNetLog& net_log) = 0; | 58 const NetLogWithSource& net_log) = 0; |
59 | 59 |
60 // Registers |observer| to receive notifications of validated SCTs. Does not | 60 // Registers |observer| to receive notifications of validated SCTs. Does not |
61 // take ownership of the observer as the observer may be performing | 61 // take ownership of the observer as the observer may be performing |
62 // URLRequests which have to be cancelled before this object is destroyed. | 62 // URLRequests which have to be cancelled before this object is destroyed. |
63 // Setting |observer| to nullptr has the effect of stopping all notifications. | 63 // Setting |observer| to nullptr has the effect of stopping all notifications. |
64 virtual void SetObserver(Observer* observer) = 0; | 64 virtual void SetObserver(Observer* observer) = 0; |
65 }; | 65 }; |
66 | 66 |
67 } // namespace net | 67 } // namespace net |
68 | 68 |
69 #endif // NET_CERT_CT_VERIFIER_H_ | 69 #endif // NET_CERT_CT_VERIFIER_H_ |
OLD | NEW |