Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 #ifndef NET_CERT_CERT_POLICY_ENFORCER_H | |
| 5 #define NET_CERT_CERT_POLICY_ENFORCER_H | |
| 6 | |
| 7 #include <stddef.h> | |
| 8 | |
| 9 #include "net/base/net_export.h" | |
| 10 | |
| 11 namespace net { | |
| 12 | |
| 13 namespace ct { | |
| 14 | |
| 15 struct CTVerifyResult; | |
| 16 class EVCertsWhitelist; | |
| 17 | |
| 18 } // namespace ct | |
| 19 | |
| 20 class X509Certificate; | |
| 21 | |
| 22 // Class for checking that a given certificate conforms to security-related | |
| 23 // policies. | |
| 24 class NET_EXPORT CertPolicyEnforcer { | |
| 25 public: | |
| 26 // Set the parameters for this policy enforcer: | |
| 27 // |num_ct_logs| is the number of Certificate Transparency log currently | |
| 28 // known to Chrome. | |
| 29 // |require_ct_for_ev| indicates whether Certificate Transparency presence | |
| 30 // is required for EV certificates. | |
| 31 CertPolicyEnforcer(size_t num_ct_logs, bool require_ct_for_ev); | |
| 32 virtual ~CertPolicyEnforcer(); | |
| 33 | |
| 34 // Returns true if the collection of SCTs for the given certificate | |
| 35 // conforms with the CT/EV policy and CT presence is required for EV | |
| 36 // certificates (as indicated in the c'tor). | |
|
Ryan Sleevi
2014/11/28 15:27:44
I'd dropped everything from this comment beginning
Eran Messeri
2014/12/01 13:59:03
Done.
| |
| 37 // |cert| is the certificate for which the SCTs apply (this is needed | |
| 38 // to determine the certificate's lifetime). | |
|
Ryan Sleevi
2014/11/28 15:27:44
Drop the ( ... ) comment
Eran Messeri
2014/12/01 13:59:03
Done.
| |
| 39 // |ct_result| is the CTVerifyResult filled in by the Verify call. | |
|
Ryan Sleevi
2014/11/28 15:27:44
This comment needs more fleshing out
// |ct_resul
Eran Messeri
2014/12/01 13:59:03
Done.
| |
| 40 bool DoesConformToCTEVPolicy(X509Certificate* cert, | |
| 41 const ct::EVCertsWhitelist* ev_whitelist, | |
| 42 const ct::CTVerifyResult& ct_result); | |
| 43 | |
| 44 private: | |
| 45 size_t num_ct_logs_; | |
| 46 bool enforce_ct_requirement_; | |
|
Ryan Sleevi
2014/11/28 15:27:44
NIT: name this consistently with your constructor
Eran Messeri
2014/12/01 13:59:03
Done.
| |
| 47 }; | |
| 48 | |
| 49 } // namespace net | |
| 50 | |
| 51 #endif // NET_CERT_CERT_POLICY_ENFORCER_H | |
| OLD | NEW |