OLD | NEW |
(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 COMPONENTS_CRYPTAUTH_SESSION_KEYS_H_ |
| 6 #define COMPONENTS_CRYPTAUTH_SESSION_KEYS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 |
| 12 namespace cryptauth { |
| 13 |
| 14 // This class contains the secure channel (secure context) session keys. This |
| 15 // class derives (from the master symmetric key) different keys for encryption |
| 16 // and decryption. The protocol initiator (i.e. the Chromebook) should use |
| 17 // |initiator_encode_key()| to encrypt the messages, and the responder should |
| 18 // use |responder_encode_key()|. This is reversed for decryption. |
| 19 class SessionKeys { |
| 20 public: |
| 21 // Create session keys derived from the |master_symmetric_key|. |
| 22 explicit SessionKeys(const std::string& master_symmetric_key); |
| 23 |
| 24 SessionKeys(); |
| 25 |
| 26 virtual ~SessionKeys(); |
| 27 |
| 28 virtual std::string initiator_encode_key() const; |
| 29 virtual std::string responder_encode_key() const; |
| 30 |
| 31 private: |
| 32 // The initiator encoding key. |
| 33 std::string initiator_encode_key_; |
| 34 |
| 35 // The responder encoding key. |
| 36 std::string responder_encode_key_; |
| 37 }; |
| 38 |
| 39 } // namespace cryptauth |
| 40 |
| 41 #endif // COMPONENTS_CRYPTAUTH_SESSION_KEYS_H_ |
OLD | NEW |