summaryrefslogtreecommitdiffstats
path: root/net/cert/ct_ev_whitelist.h
blob: f31b7a1d4fbd008cb4628b8576ba656fd3226e82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_CERT_CT_EV_WHITELIST_H_
#define NET_CERT_CT_EV_WHITELIST_H_

#include <string>

#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"

namespace base {

class Version;

}  // namespace base

namespace net {

namespace ct {

class NET_EXPORT EVCertsWhitelist
    : public base::RefCountedThreadSafe<EVCertsWhitelist> {
 public:
  // Returns true if the |certificate_hash| appears in the EV certificate hashes
  // whitelist.
  virtual bool ContainsCertificateHash(
      const std::string& certificate_hash) const = 0;

  // Returns true if the global EV certificate hashes whitelist is non-empty,
  // false otherwise.
  virtual bool IsValid() const = 0;

  // Returns the version of the whitelist in use
  virtual base::Version Version() const = 0;

 protected:
  virtual ~EVCertsWhitelist() {}

 private:
  friend class base::RefCountedThreadSafe<EVCertsWhitelist>;
};

}  // namespace ct

}  // namespace net

#endif  // NET_CERT_CT_EV_WHITELIST_H_