blob: fb6f4847cfe903711c09cc658700140831f2bd02 [file] [log] [blame]
eranm6571b2b2014-12-03 15:53:231// 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.
estark723b5eeb2016-02-18 21:01:124
bnc3698b0a02016-12-09 23:36:505#ifndef NET_CERT_CT_POLICY_ENFORCER_H_
6#define NET_CERT_CT_POLICY_ENFORCER_H_
eranm6571b2b2014-12-03 15:53:237
8#include <stddef.h>
estark723b5eeb2016-02-18 21:01:129#include <vector>
eranm6571b2b2014-12-03 15:53:2310
11#include "net/base/net_export.h"
estark723b5eeb2016-02-18 21:01:1212#include "net/cert/signed_certificate_timestamp.h"
eranm6571b2b2014-12-03 15:53:2313
14namespace net {
15
mikecironef22f9812016-10-04 03:40:1916class NetLogWithSource;
17
eranm6571b2b2014-12-03 15:53:2318namespace ct {
19
Emily Stark627238f2017-11-29 03:29:5420enum class CTPolicyCompliance;
eranm6571b2b2014-12-03 15:53:2321
22} // namespace ct
23
24class X509Certificate;
25
estark723b5eeb2016-02-18 21:01:1226using SCTList = std::vector<scoped_refptr<ct::SignedCertificateTimestamp>>;
27
estark0fc8d0782016-02-25 20:41:2028// Class for checking that a given certificate conforms to
29// Certificate Transparency-related policies.
estark6f9b3d82016-01-12 21:37:0530class NET_EXPORT CTPolicyEnforcer {
eranm6571b2b2014-12-03 15:53:2331 public:
estark6f9b3d82016-01-12 21:37:0532 CTPolicyEnforcer() {}
33 virtual ~CTPolicyEnforcer() {}
rsleevi9541f8632015-07-31 00:07:0034
estark0fc8d0782016-02-25 20:41:2035 // 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 Stark627238f2017-11-29 03:29:5441 virtual ct::CTPolicyCompliance CheckCompliance(
estark0fc8d0782016-02-25 20:41:2042 X509Certificate* cert,
43 const SCTList& verified_scts,
tfarina428341112016-09-22 13:38:2044 const NetLogWithSource& net_log);
eranm6571b2b2014-12-03 15:53:2345};
46
47} // namespace net
48
bnc3698b0a02016-12-09 23:36:5049#endif // NET_CERT_CT_POLICY_ENFORCER_H_