| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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_TRANSPORT_SECURITY_STATE_INPUT_FILE_PARSERS_H_ |
| 6 #define NET_TOOLS_TRANSPORT_SECURITY_STATE_INPUT_FILE_PARSERS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/strings/string_piece.h" |
| 11 #include "net/tools/transport_security_state_generator/transport_security_state_
entry.h" |
| 12 |
| 13 namespace net { |
| 14 |
| 15 namespace transport_security_state { |
| 16 |
| 17 class Pinsets; |
| 18 |
| 19 // Extracts SPKI information from the preloaded pins file. The SPKI's can be |
| 20 // in the form of a PEM certificate, a PEM public key, or a BASE64 string. |
| 21 // |
| 22 // More info on the format can be found in |
| 23 // net/http/transport_security_state_static.pins |
| 24 bool ParseCertificatesFile(base::StringPiece certs_input, Pinsets* pinsets); |
| 25 |
| 26 // Parses the |json| string and copies the items under the "entries" key to |
| 27 // |entries|, the pinsets under the "pinsets" key to |pinsets|, and the domain |
| 28 // IDs under the "domain_ids" key to |domain_ids|. |
| 29 // |
| 30 // More info on the format can be found in |
| 31 // net/http/transport_security_state_static.json |
| 32 bool ParseJSON(base::StringPiece json, |
| 33 TransportSecurityStateEntries* entries, |
| 34 Pinsets* pinsets, |
| 35 DomainIDList* domain_ids); |
| 36 |
| 37 } // namespace transport_security_state |
| 38 |
| 39 } // namespace net |
| 40 |
| 41 #endif // NET_TOOLS_TRANSPORT_SECURITY_STATE_INPUT_FILE_PARSERS_H_ |
| OLD | NEW |