Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: net/cert/ct_verifier.h

Issue 1216153010: Certificate Transparency: Add observer for Signed Certificate Timestamps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/cert/multi_log_ct_verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_verifier.h
diff --git a/net/cert/ct_verifier.h b/net/cert/ct_verifier.h
index 290a0474a649138733c902fdc5a8e47b6210f12d..40631048ac32d21b41b5f220ee78e8c86f7aef4d 100644
--- a/net/cert/ct_verifier.h
+++ b/net/cert/ct_verifier.h
@@ -5,20 +5,35 @@
#ifndef NET_CERT_CT_VERIFIER_H_
#define NET_CERT_CT_VERIFIER_H_
+#include <string>
+
#include "net/base/net_export.h"
namespace net {
namespace ct {
struct CTVerifyResult;
+struct SignedCertificateTimestamp;
} // namespace ct
class BoundNetLog;
+class CTLogVerifier;
class X509Certificate;
// Interface for verifying Signed Certificate Timestamps over a certificate.
class NET_EXPORT CTVerifier {
public:
+ class NET_EXPORT Observer {
+ public:
+ // Called for each Signed Certificate Timestamp from a known log that vas
+ // verified successfully (i.e. the signature verifies). |sct| is the
+ // Signed Certificate Timestamp, |cert| is the certificate it applies to.
+ // The certificate is needed to calculate the hash of the log entry,
+ // necessary for checking inclusion in the log.
+ virtual void OnSCTVerified(X509Certificate* cert,
+ const ct::SignedCertificateTimestamp* sct) = 0;
+ };
+
virtual ~CTVerifier() {}
// Verifies SCTs embedded in the certificate itself, SCTs embedded in a
@@ -36,6 +51,12 @@ class NET_EXPORT CTVerifier {
const std::string& sct_list_from_tls_extension,
ct::CTVerifyResult* result,
const BoundNetLog& net_log) = 0;
+
+ // Registers |observer| to receive notifications of validated SCTs. Does not
+ // take ownership of the observer as the observer may be performing
+ // URLRequests which have to be cancelled before this object is destroyed.
+ // Setting |observer| to nullptr has the effect of stopping all notifications.
+ virtual void SetObserver(Observer* observer) = 0;
};
} // namespace net
« no previous file with comments | « no previous file | net/cert/multi_log_ct_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698