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

Side by Side Diff: media/cast/common/transport_encryption_handler.h

Issue 388663003: Cast: Reshuffle files under media/cast (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing includes Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_CAST_TRANSPORT_TRANSPORT_UTILITY_ENCRYPTION_HANDLER_H_ 5 #ifndef MEDIA_CAST_COMMON_TRANSPORT_ENCRYPTION_HANDLER_H_
6 #define MEDIA_CAST_TRANSPORT_TRANSPORT_UTILITY_ENCRYPTION_HANDLER_H_ 6 #define MEDIA_CAST_COMMON_TRANSPORT_ENCRYPTION_HANDLER_H_
7 7
8 // Helper class to handle encryption for the Cast Transport library. 8 // Helper class to handle encryption for the Cast Transport library.
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string_piece.h" 13 #include "base/strings/string_piece.h"
14 #include "base/threading/non_thread_safe.h" 14 #include "base/threading/non_thread_safe.h"
15 15
16 namespace crypto { 16 namespace crypto {
17 class Encryptor; 17 class Encryptor;
18 class SymmetricKey; 18 class SymmetricKey;
19 } 19 }
20 20
21 namespace media { 21 namespace media {
22 namespace cast { 22 namespace cast {
23 namespace transport {
24 23
25 class TransportEncryptionHandler : public base::NonThreadSafe { 24 class TransportEncryptionHandler : public base::NonThreadSafe {
26 public: 25 public:
27 TransportEncryptionHandler(); 26 TransportEncryptionHandler();
28 ~TransportEncryptionHandler(); 27 ~TransportEncryptionHandler();
29 28
30 bool Initialize(std::string aes_key, std::string aes_iv_mask); 29 bool Initialize(std::string aes_key, std::string aes_iv_mask);
31 30
32 bool Encrypt(uint32 frame_id, 31 bool Encrypt(uint32 frame_id,
33 const base::StringPiece& data, 32 const base::StringPiece& data,
34 std::string* encrypted_data); 33 std::string* encrypted_data);
35 34
36 bool Decrypt(uint32 frame_id, 35 bool Decrypt(uint32 frame_id,
37 const base::StringPiece& ciphertext, 36 const base::StringPiece& ciphertext,
38 std::string* plaintext); 37 std::string* plaintext);
39 38
40 bool is_activated() const { return is_activated_; } 39 bool is_activated() const { return is_activated_; }
41 40
42 private: 41 private:
43 scoped_ptr<crypto::SymmetricKey> key_; 42 scoped_ptr<crypto::SymmetricKey> key_;
44 scoped_ptr<crypto::Encryptor> encryptor_; 43 scoped_ptr<crypto::Encryptor> encryptor_;
45 std::string iv_mask_; 44 std::string iv_mask_;
46 bool is_activated_; 45 bool is_activated_;
47 46
48 DISALLOW_COPY_AND_ASSIGN(TransportEncryptionHandler); 47 DISALLOW_COPY_AND_ASSIGN(TransportEncryptionHandler);
49 }; 48 };
50 49
51 } // namespace transport
52 } // namespace cast 50 } // namespace cast
53 } // namespace media 51 } // namespace media
54 52
55 #endif // MEDIA_CAST_TRANSPORT_TRANSPORT_UTILITY_ENCRYPTION_HANDLER_H_ 53 #endif // MEDIA_CAST_COMMON_TRANSPORT_ENCRYPTION_HANDLER_H_
OLDNEW
« no previous file with comments | « media/cast/common/clock_drift_smoother.cc ('k') | media/cast/common/transport_encryption_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698