Upstream version 10.39.233.0
[platform/framework/web/crosswalk.git] / src / remoting / host / pin_hash.h
1 // Copyright (c) 2012 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 REMOTING_HOST_PIN_HASH_H_
6 #define REMOTING_HOST_PIN_HASH_H_
7
8 #include <string>
9
10 namespace remoting {
11
12 // Creates a Me2Me shared-secret hash, consisting of the hash method, and the
13 // hashed host ID and PIN.
14 std::string MakeHostPinHash(const std::string& host_id, const std::string& pin);
15
16 // Extracts the hash function from the given hash, uses it to calculate the
17 // hash of the given host ID and PIN, and compares that hash to the given hash.
18 // Returns true if the calculated and given hashes are equal.
19 bool VerifyHostPinHash(const std::string& hash,
20                        const std::string& host_id,
21                        const std::string& pin);
22
23 }  // namespace remoting
24
25 #endif  // REMOTING_HOST_PIN_HASH_