| 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 BoundNetLog; |
| 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 // The only known (non-test) implementation currently is MultiLogCTVerifier. |
| 24 class NET_EXPORT CTVerifier { | 25 class NET_EXPORT CTVerifier { |
| 25 public: | 26 public: |
| 26 class NET_EXPORT Observer { | 27 class NET_EXPORT Observer { |
| 27 public: | 28 public: |
| 28 // Called for each Signed Certificate Timestamp from a known log that vas | 29 // Called for each Signed Certificate Timestamp from a known log that vas |
| 29 // verified successfully (i.e. the signature verifies). |sct| is the | 30 // verified successfully (i.e. the signature verifies). |sct| is the |
| 30 // Signed Certificate Timestamp, |cert| is the certificate it applies to. | 31 // Signed Certificate Timestamp, |cert| is the certificate it applies to. |
| 31 // The certificate is needed to calculate the hash of the log entry, | 32 // The certificate is needed to calculate the hash of the log entry, |
| 32 // necessary for checking inclusion in the log. | 33 // necessary for checking inclusion in the log. |
| 34 // Note: The observer (whose implementation is expected to exist outside |
| 35 // net/) may store the observed |cert| and |sct|. |
| 33 virtual void OnSCTVerified(X509Certificate* cert, | 36 virtual void OnSCTVerified(X509Certificate* cert, |
| 34 const ct::SignedCertificateTimestamp* sct) = 0; | 37 const ct::SignedCertificateTimestamp* sct) = 0; |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 virtual ~CTVerifier() {} | 40 virtual ~CTVerifier() {} |
| 38 | 41 |
| 39 // Verifies SCTs embedded in the certificate itself, SCTs embedded in a | 42 // Verifies SCTs embedded in the certificate itself, SCTs embedded in a |
| 40 // stapled OCSP response, and SCTs obtained via the | 43 // stapled OCSP response, and SCTs obtained via the |
| 41 // signed_certificate_timestamp TLS extension on the given |cert|. | 44 // signed_certificate_timestamp TLS extension on the given |cert|. |
| 42 // A certificate is permitted but not required to use multiple sources for | 45 // A certificate is permitted but not required to use multiple sources for |
| (...skipping 12 matching lines...) Expand all Loading... |
| 55 // Registers |observer| to receive notifications of validated SCTs. Does not | 58 // Registers |observer| to receive notifications of validated SCTs. Does not |
| 56 // take ownership of the observer as the observer may be performing | 59 // take ownership of the observer as the observer may be performing |
| 57 // URLRequests which have to be cancelled before this object is destroyed. | 60 // URLRequests which have to be cancelled before this object is destroyed. |
| 58 // Setting |observer| to nullptr has the effect of stopping all notifications. | 61 // Setting |observer| to nullptr has the effect of stopping all notifications. |
| 59 virtual void SetObserver(Observer* observer) = 0; | 62 virtual void SetObserver(Observer* observer) = 0; |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 } // namespace net | 65 } // namespace net |
| 63 | 66 |
| 64 #endif // NET_CERT_CT_VERIFIER_H_ | 67 #endif // NET_CERT_CT_VERIFIER_H_ |
| OLD | NEW |