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 "net/tools/transport_security_state_generator/transport_security_state_
entry.h" |
| 11 |
| 12 namespace net { |
| 13 |
| 14 namespace transport_security_state { |
| 15 |
| 16 class Pinsets; |
| 17 |
| 18 // Extracts all entries, pinsets, and domain IDs from the JSON structure in |
| 19 // |json|. Returns true on success and populates |*entries|, |*pinsets|, and |
| 20 // |*domain_ids| with the corresponding values. Returns false on failure and |
| 21 // appends all errors to |*errors|. |
| 22 // |
| 23 // More info on the format can be found in |
| 24 // net/http/transport_security_state_static.json |
| 25 bool ParseJSON(const std::string& json, |
| 26 TransportSecurityStateEntries* entries, |
| 27 Pinsets* pinsets, |
| 28 DomainIDList* domain_ids, |
| 29 std::vector<std::string>* errors); |
| 30 |
| 31 // Extracts SPKI information from the preloaded pins file. The SPKI's can be |
| 32 // in the form of a PEM certificate, a PEM public key, or a BASE64 string. |
| 33 // Returns true on success and adds all pinsets to |*pinsets|. Returns false on |
| 34 // failure and appends all errors to |*errors|. |
| 35 // |
| 36 // More info on the format can be found in |
| 37 // net/http/transport_security_state_static.pins |
| 38 bool ParseCertificatesFile(const std::string& certs_input, |
| 39 Pinsets* pinsets, |
| 40 std::vector<std::string>* errors); |
| 41 |
| 42 } // namespace transport_security_state |
| 43 |
| 44 } // namespace net |
| 45 |
| 46 #endif // NET_TOOLS_TRANSPORT_SECURITY_STATE_INPUT_FILE_PARSERS_H_ |
OLD | NEW |