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

Side by Side Diff: chrome/browser/local_discovery/privetv3_crypto_provider.h

Issue 316873004: Interface plus stub implementation for PrivetV3CryptoProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | chrome/browser/local_discovery/privetv3_crypto_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_CRYPTO_PROVIDER_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_CRYPTO_PROVIDER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/memory/scoped_ptr.h"
12
13 namespace local_discovery {
14
15 class PrivetV3CryptoProvider {
16 public:
17 virtual ~PrivetV3CryptoProvider() {}
18
19 static scoped_ptr<PrivetV3CryptoProvider> Create(
20 const std::vector<std::string>& available_auth_methods);
21
22 // Return the authentication method used.
23 virtual const std::string& GetAuthMethod() = 0;
Vitaly Buka (NO REVIEWS) 2014/06/05 07:50:00 const std::string& -> std::string const ref makes
24
25 // Get the next handshake command. |step| is the step number to send,
26 // |package| is a base64-encoded package to send with the step. Return
27 // |true| if a package is generated or |false| in case of an error.
28 virtual bool GetNextStep(int* step, std::string* package) = 0;
29
30 // Input the response to the handshake command. |step| is the received step
31 // number, |package| is the received base64-encoded package. Return |true| if
32 // the step was successfully processed or |false| in case of an error.
33 virtual bool SetStepResponse(int step, const std::string& package) = 0;
34
35 // Encrypt a string using the session key.
36 virtual bool EncryptData(const std::string& input, std::string* output) = 0;
37 };
38
39 } // namespace local_discovery
40
41 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_CRYPTO_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/local_discovery/privetv3_crypto_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698