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

Side by Side Diff: net/tools/transport_security_state_generator/input_file_parsers.h

Issue 2793823002: Add unittests for certificate and file parsing. (Closed)
Patch Set: comments davidben Created 3 years, 8 months 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 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698