Chromium Code Reviews| Index: chrome/browser/local_discovery/privetv3_crypto_provider.h |
| diff --git a/chrome/browser/local_discovery/privetv3_crypto_provider.h b/chrome/browser/local_discovery/privetv3_crypto_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..27d4945357556983d2f6e729da9200116b682582 |
| --- /dev/null |
| +++ b/chrome/browser/local_discovery/privetv3_crypto_provider.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2014 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 CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_CRYPTO_PROVIDER_H_ |
| +#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_CRYPTO_PROVIDER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/memory/scoped_ptr.h" |
| + |
| +namespace local_discovery { |
| + |
| +class PrivetV3CryptoProvider { |
| + public: |
| + virtual ~PrivetV3CryptoProvider() {} |
| + |
| + static scoped_ptr<PrivetV3CryptoProvider> Create( |
| + const std::vector<std::string>& available_auth_methods); |
| + |
| + // Return the authentication method used. |
| + virtual const std::string& GetAuthMethod() = 0; |
|
Vitaly Buka (NO REVIEWS)
2014/06/05 07:50:00
const std::string& -> std::string
const ref makes
|
| + |
| + // Get the next handshake command. |step| is the step number to send, |
| + // |package| is a base64-encoded package to send with the step. Return |
| + // |true| if a package is generated or |false| in case of an error. |
| + virtual bool GetNextStep(int* step, std::string* package) = 0; |
| + |
| + // Input the response to the handshake command. |step| is the received step |
| + // number, |package| is the received base64-encoded package. Return |true| if |
| + // the step was successfully processed or |false| in case of an error. |
| + virtual bool SetStepResponse(int step, const std::string& package) = 0; |
| + |
| + // Encrypt a string using the session key. |
| + virtual bool EncryptData(const std::string& input, std::string* output) = 0; |
| +}; |
| + |
| +} // namespace local_discovery |
| + |
| +#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV3_CRYPTO_PROVIDER_H_ |