• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "net/tools/transport_security_state_generator/pinsets.h"
6 
7 #include "base/strings/string_piece.h"
8 #include "net/tools/transport_security_state_generator/spki_hash.h"
9 
10 namespace net::transport_security_state {
11 
12 Pinsets::Pinsets() = default;
13 
14 Pinsets::~Pinsets() = default;
15 
RegisterSPKIHash(base::StringPiece name,const SPKIHash & hash)16 void Pinsets::RegisterSPKIHash(base::StringPiece name, const SPKIHash& hash) {
17   spki_hashes_.insert(
18       std::pair<std::string, SPKIHash>(std::string(name), hash));
19 }
20 
RegisterPinset(std::unique_ptr<Pinset> pinset)21 void Pinsets::RegisterPinset(std::unique_ptr<Pinset> pinset) {
22   pinsets_.insert(std::pair<std::string, std::unique_ptr<Pinset>>(
23       pinset->name(), std::move(pinset)));
24 }
25 
26 }  // namespace net::transport_security_state
27