OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 COMPONENTS_GCM_DRIVER_CRYPTO_ENCRYPTION_HEADER_PARSERS_H_ | |
6 #define COMPONENTS_GCM_DRIVER_CRYPTO_ENCRYPTION_HEADER_PARSERS_H_ | |
7 | |
8 #include <stdint.h> | |
9 #include <string> | |
10 | |
11 namespace gcm { | |
12 | |
13 // Parses |input| following the syntax of the Encryption HTTP header. Chrome | |
14 // only supports a single set of properties to be read from the header at this | |
15 // time. The base64url encoded salt will be decoded, the rs will be validated. | |
16 // | |
17 // https://tools.ietf.org/html/draft-thomson-http-encryption-01#section-3 | |
18 // | |
19 // Returns whether the |input| was successfully be parsed, and the resulting | |
20 // information was stored in |keyid|, |salt| and |rs|. The output arguments will | |
21 // not be changed unless parsing was successful. | |
22 bool ParseEncryptionHeader(const std::string& input, | |
23 std::string* keyid, | |
24 std::string* salt, | |
25 int64_t* rs); | |
eroman
2015/09/25 18:18:19
uint64_t, since |rs| must be non-negative (in fact
Peter Beverloo
2015/09/28 11:27:15
Done.
| |
26 | |
27 // Parses |input| following the syntax of the Encryption-Key HTTP header. Chrome | |
28 // only supports a single set of properties to be read from the header at this | |
29 // time. The base64url encoded key and dh will be decoded. | |
30 // | |
31 // https://tools.ietf.org/html/draft-thomson-http-encryption-01#section-4 | |
32 // | |
33 // Returns whether |input| was successfully parsed, and the resulting | |
34 // information was stored in |keyid|, |key| and |dh|. The output arguments will | |
35 // not be changed unless parsing was successful. | |
36 bool ParseEncryptionKeyHeader(const std::string& input, | |
37 std::string* keyid, | |
38 std::string* key, | |
39 std::string* dh); | |
40 | |
41 } // namespace gcm | |
42 | |
43 #endif // COMPONENTS_GCM_DRIVER_CRYPTO_ENCRYPTION_HEADER_PARSERS_H_ | |
OLD | NEW |