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

Side by Side Diff: net/http/http_mac_signature.h

Issue 6901121: MAC Cookies (patch 2 of N) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_mac_signature.cc » ('j') | net/http/http_mac_signature.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 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_HTTP_MAC_SIGNATURE_H_
6 #define NET_HTTP_MAC_SIGNATURE_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/gtest_prod_util.h"
13 #include "crypto/hmac.h"
14
15 namespace net {
16
17 class HttpMacSignature {
18 public:
19 HttpMacSignature();
20 ~HttpMacSignature();
21
22 // Returns whether this information is valid.
23 bool AddStateInfo(const std::string& id,
24 const std::string& mac_key,
25 const std::string& mac_algorithm,
26 const std::string& issuer);
27
28 // Returns whether this information is valid.
29 bool AddHttpInfo(const std::string& method,
30 const std::string& request_uri,
31 const std::string& host,
32 int port);
33
34 std::string GenerateAuthorizationHeader();
35
36 private:
37 FRIEND_TEST_ALL_PREFIXES(HttpMacSignatureTest, GenerateNormalizedRequest);
38 FRIEND_TEST_ALL_PREFIXES(HttpMacSignatureTest, GenerateMAC);
39
40 std::string GenerateNormalizedRequest(const std::string& timestamp,
41 const std::string& nonce);
42
43 std::string GenerateMAC(const std::string& timestamp,
44 const std::string& nonce);
45
46 std::string id_;
47 std::string mac_key_;
48 crypto::HMAC::HashAlgorithm mac_algorithm_;
49 std::string issuer_;
50
51 std::string method_;
52 std::string request_uri_;
53 std::string host_;
54 std::string port_;
55 // TODO(abarth): body_hash_
56
57 DISALLOW_COPY_AND_ASSIGN(HttpMacSignature);
58 };
59
60 } // namespace net
61
62 #endif // NET_HTTP_MAC_SIGNATURE_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_mac_signature.cc » ('j') | net/http/http_mac_signature.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698