Chromium Code Reviews| Index: net/tools/transport_security_state_generator/input_file_parsers.h |
| diff --git a/net/tools/transport_security_state_generator/input_file_parsers.h b/net/tools/transport_security_state_generator/input_file_parsers.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d073c5f01021c4cea9db3aa79c928de24c710e26 |
| --- /dev/null |
| +++ b/net/tools/transport_security_state_generator/input_file_parsers.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2017 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_TOOLS_TRANSPORT_SECURITY_STATE_INPUT_FILE_PARSERS_H_ |
| +#define NET_TOOLS_TRANSPORT_SECURITY_STATE_INPUT_FILE_PARSERS_H_ |
| + |
| +#include <string> |
| + |
| +#include "net/tools/transport_security_state_generator/transport_security_state_entry.h" |
| + |
| +namespace net { |
| + |
| +namespace transport_security_state { |
| + |
| +class Pinsets; |
| + |
| +// Extracts SPKI information from the preloaded pins file. The SPKI's can be |
| +// in the form of a PEM certificate, a PEM public key, or a BASE64 string. |
| +// |
| +// More info on the format can be found in |
| +// net/http/transport_security_state_static.pins |
| +bool ParseCertificatesFile(const std::string& certs_input, Pinsets* pinsets); |
|
davidben
2017/04/03 20:53:02
Doesn't really matter, but base::StringPiece is ba
martijnc
2017/04/04 18:31:10
Done.
|
| + |
| +// Parses the |json| string and copies the items under the "entries" key to |
| +// |entries|, the pinsets under the "pinsets" key to |pinsets|, and the domain |
| +// IDs under the "domain_ids" key to |domain_ids|. |
| +// |
| +// More info on the format can be found in |
| +// net/http/transport_security_state_static.json |
| +bool ParseJSON(const std::string& json, |
|
davidben
2017/04/03 20:53:02
Ditto.
martijnc
2017/04/04 18:31:10
Done.
|
| + TransportSecurityStateEntries* entries, |
| + Pinsets* pinsets, |
| + DomainIDList* domain_ids); |
| + |
| +} // namespace transport_security_state |
| + |
| +} // namespace net |
| + |
| +#endif // NET_TOOLS_TRANSPORT_SECURITY_STATE_INPUT_FILE_PARSERS_H_ |