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

Side by Side Diff: net/tools/domain_security_preload_generator/pinset.h

Issue 2551153003: Add static domain security state generator tool. (Closed)
Patch Set: fix base64 issue and accidental replace. Created 4 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 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
5 #ifndef NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_PINSET_H_
6 #define NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_PINSET_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/macros.h"
12
13 namespace net {
14
15 // A pinset represents the data a website would send in a HPKP header. A pinset
agl 2016/12/06 18:51:36 s/pinset/Pinset/
martijnc 2016/12/07 22:37:54 Done.
16 // is given a name so that multiple entries in the preload list can reference
17 // the same pinset.
18 class Pinset {
19 public:
20 Pinset(std::string name, std::string report_uri);
21 ~Pinset();
22
23 const std::string& name() const { return name_; }
24 const std::string& report_uri() const { return report_uri_; }
25
26 const std::vector<std::string>& static_spki_hashes() const {
27 return static_spki_hashes_;
28 }
29 const std::vector<std::string>& bad_static_spki_hashes() const {
30 return bad_static_spki_hashes_;
31 }
32
33 // Register a good hash for this pinset. Hashes are referenced by a name, not
34 // the actual hash.
35 void AddStaticSPKIHash(const std::string& hash_name);
36
37 // Register a bad hash for this pinset. Hashes are referenced by a name, not
38 // the actual hash.
39 void AddBadStaticSPKIHash(const std::string& hash_name);
40
41 private:
42 std::string name_;
43 std::string report_uri_;
44
45 // These vectors contain names rather than actual hashes.
46 std::vector<std::string> static_spki_hashes_;
47 std::vector<std::string> bad_static_spki_hashes_;
48
49 DISALLOW_COPY_AND_ASSIGN(Pinset);
50 };
51
52 } // namespace net
53
54 #endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_PINSET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698