eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 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. |
estark | 723b5eeb | 2016-02-18 21:01:12 | [diff] [blame] | 4 | |
bnc | 3698b0a0 | 2016-12-09 23:36:50 | [diff] [blame] | 5 | #ifndef NET_CERT_CT_POLICY_ENFORCER_H_ |
| 6 | #define NET_CERT_CT_POLICY_ENFORCER_H_ |
eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 7 | |
| 8 | #include <stddef.h> |
estark | 723b5eeb | 2016-02-18 21:01:12 | [diff] [blame] | 9 | #include <vector> |
eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 10 | |
| 11 | #include "net/base/net_export.h" |
estark | 723b5eeb | 2016-02-18 21:01:12 | [diff] [blame] | 12 | #include "net/cert/signed_certificate_timestamp.h" |
eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 13 | |
| 14 | namespace net { |
| 15 | |
mikecirone | f22f981 | 2016-10-04 03:40:19 | [diff] [blame] | 16 | class NetLogWithSource; |
| 17 | |
eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 18 | namespace ct { |
| 19 | |
Emily Stark | 627238f | 2017-11-29 03:29:54 | [diff] [blame] | 20 | enum class CTPolicyCompliance; |
eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 21 | |
| 22 | } // namespace ct |
| 23 | |
| 24 | class X509Certificate; |
| 25 | |
estark | 723b5eeb | 2016-02-18 21:01:12 | [diff] [blame] | 26 | using SCTList = std::vector<scoped_refptr<ct::SignedCertificateTimestamp>>; |
| 27 | |
estark | 0fc8d078 | 2016-02-25 20:41:20 | [diff] [blame] | 28 | // Class for checking that a given certificate conforms to |
| 29 | // Certificate Transparency-related policies. |
estark | 6f9b3d8 | 2016-01-12 21:37:05 | [diff] [blame] | 30 | class NET_EXPORT CTPolicyEnforcer { |
eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 31 | public: |
estark | 6f9b3d8 | 2016-01-12 21:37:05 | [diff] [blame] | 32 | CTPolicyEnforcer() {} |
| 33 | virtual ~CTPolicyEnforcer() {} |
rsleevi | 9541f863 | 2015-07-31 00:07:00 | [diff] [blame] | 34 | |
estark | 0fc8d078 | 2016-02-25 20:41:20 | [diff] [blame] | 35 | // Returns the CT certificate policy compliance status for a given |
| 36 | // certificate and collection of SCTs. |
| 37 | // |cert| is the certificate for which to check compliance, and |
| 38 | // ||verified_scts| contains any/all SCTs associated with |cert| that |
| 39 | // |have been verified (well-formed, issued by known logs, and |
| 40 | // |applying to |cert|). |
Emily Stark | 627238f | 2017-11-29 03:29:54 | [diff] [blame] | 41 | virtual ct::CTPolicyCompliance CheckCompliance( |
estark | 0fc8d078 | 2016-02-25 20:41:20 | [diff] [blame] | 42 | X509Certificate* cert, |
| 43 | const SCTList& verified_scts, |
tfarina | 42834111 | 2016-09-22 13:38:20 | [diff] [blame] | 44 | const NetLogWithSource& net_log); |
eranm | 6571b2b | 2014-12-03 15:53:23 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | } // namespace net |
| 48 | |
bnc | 3698b0a0 | 2016-12-09 23:36:50 | [diff] [blame] | 49 | #endif // NET_CERT_CT_POLICY_ENFORCER_H_ |